Skip to content

Commit

Permalink
fix(curriculum tests): test cert projects (freeCodeCamp#52959)
Browse files Browse the repository at this point in the history
Co-authored-by: Krzysztof G. <60067306+gikf@users.noreply.github.com>
  • Loading branch information
moT01 and gikf authored Jan 9, 2024
1 parent 09e1fda commit b0e3ba0
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```

```css

```
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```

```css

```
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```

```css

```
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```

```css

```
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```

```css

```
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```

```css

```
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```

```css

```
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```

```css

```
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```

```css

```
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```

```css

```
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```

```css

```
18 changes: 6 additions & 12 deletions curriculum/test/test-challenges.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
25 changes: 25 additions & 0 deletions shared/config/challenge-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit b0e3ba0

Please sign in to comment.