mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-02-25 14:01:29 -05:00
fix(curriculum tests): test cert projects (#52959)
Co-authored-by: Krzysztof G. <60067306+gikf@users.noreply.github.com>
This commit is contained in:
@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
```css
|
||||
|
||||
```
|
||||
|
||||
@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
```css
|
||||
|
||||
```
|
||||
|
||||
@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
```css
|
||||
|
||||
```
|
||||
|
||||
@@ -204,3 +204,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
```css
|
||||
|
||||
```
|
||||
|
||||
@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
```css
|
||||
|
||||
```
|
||||
|
||||
@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
```css
|
||||
|
||||
```
|
||||
|
||||
@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
```css
|
||||
|
||||
```
|
||||
|
||||
@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
```css
|
||||
|
||||
```
|
||||
|
||||
@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
```css
|
||||
|
||||
```
|
||||
|
||||
@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
```css
|
||||
|
||||
```
|
||||
|
||||
@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
```css
|
||||
|
||||
```
|
||||
|
||||
@@ -31,7 +31,10 @@ const {
|
||||
const {
|
||||
default: createWorker
|
||||
} = require('../../client/src/templates/Challenges/utils/worker-executor');
|
||||
const { challengeTypes } = require('../../shared/config/challenge-types');
|
||||
const {
|
||||
challengeTypes,
|
||||
hasNoSolution
|
||||
} = require('../../shared/config/challenge-types');
|
||||
// the config files are created during the build, but not before linting
|
||||
const javaScriptTestEvaluator =
|
||||
require('../../client/config/browser-scripts/test-evaluator.json').filename;
|
||||
@@ -370,17 +373,8 @@ function populateTestsForLang({ lang, challenges, meta }) {
|
||||
});
|
||||
|
||||
const { challengeType } = challenge;
|
||||
// TODO: shouldn't this be a function in challenge-types.js?
|
||||
if (
|
||||
challengeType !== challengeTypes.html &&
|
||||
challengeType !== challengeTypes.js &&
|
||||
challengeType !== challengeTypes.jsProject &&
|
||||
challengeType !== challengeTypes.modern &&
|
||||
challengeType !== challengeTypes.backend &&
|
||||
challengeType !== challengeTypes.python
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasNoSolution(challengeType)) return;
|
||||
|
||||
let { tests = [] } = challenge;
|
||||
tests = tests.filter(test => !!test.testString);
|
||||
|
||||
@@ -79,6 +79,31 @@ export const hasNoTests = (challengeType: number): boolean =>
|
||||
challengeType === dialogue ||
|
||||
challengeType === fillInTheBlank;
|
||||
|
||||
export const hasNoSolution = (challengeType: number): boolean => {
|
||||
const noSolutions = [
|
||||
backend,
|
||||
zipline,
|
||||
frontEndProject,
|
||||
backEndProject,
|
||||
step,
|
||||
quiz,
|
||||
invalid,
|
||||
pythonProject,
|
||||
video,
|
||||
codeAllyPractice,
|
||||
codeAllyCert,
|
||||
theOdinProject,
|
||||
colab,
|
||||
exam,
|
||||
msTrophy,
|
||||
multipleChoice,
|
||||
dialogue,
|
||||
fillInTheBlank
|
||||
];
|
||||
|
||||
return noSolutions.includes(challengeType);
|
||||
};
|
||||
|
||||
// determine the component view for each challenge
|
||||
export const viewTypes = {
|
||||
[html]: 'classic',
|
||||
|
||||
Reference in New Issue
Block a user