fix(curriculum tests): test cert projects (#52959)

Co-authored-by: Krzysztof G. <60067306+gikf@users.noreply.github.com>
This commit is contained in:
Tom
2024-01-09 13:03:07 -06:00
committed by GitHub
parent 09e1fdad28
commit b0e3ba0b90
13 changed files with 75 additions and 12 deletions

View File

@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```
```css
```

View File

@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```
```css
```

View File

@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```
```css
```

View File

@@ -204,3 +204,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```
```css
```

View File

@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```
```css
```

View File

@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```
```css
```

View File

@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```
```css
```

View File

@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```
```css
```

View File

@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```
```css
```

View File

@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```
```css
```

View File

@@ -202,3 +202,7 @@ assert(allAnchorsHaveHrefHash && anchorTags.length > 0);
</body>
</html>
```
```css
```

View File

@@ -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);

View File

@@ -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',