mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
refactor: remove jest and lint vitest (#62330)
This commit is contained in:
committed by
GitHub
parent
d96d528e8c
commit
51eba06a7d
@@ -1,118 +1,5 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`challenge parser > it should not parse directives we do not use 1`] = `
|
||||
{
|
||||
"assignments": [],
|
||||
"description": "<section id="description">
|
||||
<p>:root appears, :import appears</p>
|
||||
<p>the next paragraph should appear</p>
|
||||
::import
|
||||
<p>even though it's an import directive, but if we use the full syntax <code>::directive-name{attr="name" attr2="a/path"}</code></p>
|
||||
<p>it goes.</p>
|
||||
<p>::: name [inline-content] {key=val}
|
||||
a container directive
|
||||
:::</p>
|
||||
</section>",
|
||||
"solutions": [],
|
||||
"tests": [],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`challenge parser > it should parse md with a scene 1`] = `
|
||||
{
|
||||
"assignments": [],
|
||||
"description": "<section id="description">
|
||||
<p>This challenge has a scene.</p>
|
||||
</section>",
|
||||
"scene": {
|
||||
"commands": [
|
||||
{
|
||||
"character": "Maria",
|
||||
"opacity": 1,
|
||||
"startTime": 0,
|
||||
},
|
||||
{
|
||||
"character": "Maria",
|
||||
"dialogue": {
|
||||
"align": "center",
|
||||
"text": "I'm Maria, the team lead.",
|
||||
},
|
||||
"finishTime": 2.4,
|
||||
"startTime": 0.7,
|
||||
},
|
||||
{
|
||||
"character": "Maria",
|
||||
"opacity": 0,
|
||||
"startTime": 3.4,
|
||||
},
|
||||
],
|
||||
"setup": {
|
||||
"audio": {
|
||||
"filename": "1.1-1.mp3",
|
||||
"finishTimestamp": 4,
|
||||
"startTime": 1,
|
||||
"startTimestamp": 2.6,
|
||||
},
|
||||
"background": "company2-center.png",
|
||||
"characters": [
|
||||
{
|
||||
"character": "Maria",
|
||||
"opacity": 0,
|
||||
"position": {
|
||||
"x": 50,
|
||||
"y": 0,
|
||||
"z": 1.5,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
"solutions": [],
|
||||
"tests": [],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`challenge parser > it should parse video questions 1`] = `
|
||||
{
|
||||
"assignments": [],
|
||||
"description": "<section id="description">
|
||||
<p>Paragraph 1</p>
|
||||
<pre><code class="language-html">code example
|
||||
</code></pre>
|
||||
</section>",
|
||||
"instructions": "<section id="instructions">
|
||||
<p>Paragraph 0</p>
|
||||
<pre><code class="language-html">code example 0
|
||||
</code></pre>
|
||||
</section>",
|
||||
"questions": [
|
||||
{
|
||||
"answers": [
|
||||
{
|
||||
"answer": "<p>Some inline <code>code</code></p>",
|
||||
"feedback": "<p>That is not correct.</p>",
|
||||
},
|
||||
{
|
||||
"answer": "<p>Some <em>italics</em></p>
|
||||
<p>A second answer paragraph.</p>",
|
||||
"feedback": null,
|
||||
},
|
||||
{
|
||||
"answer": "<p><code> code in </code> code tags</p>",
|
||||
"feedback": null,
|
||||
},
|
||||
],
|
||||
"solution": 3,
|
||||
"text": "<p>Question line 1</p>
|
||||
<pre><code class="language-js"> var x = 'y';
|
||||
</code></pre>",
|
||||
},
|
||||
],
|
||||
"solutions": [],
|
||||
"tests": [],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`challenge parser > should import md from other files 1`] = `
|
||||
{
|
||||
"assignments": [],
|
||||
@@ -243,6 +130,24 @@ exports[`challenge parser > should not mix other YAML with the frontmatter 1`] =
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`challenge parser > should not parse directives we do not use 1`] = `
|
||||
{
|
||||
"assignments": [],
|
||||
"description": "<section id="description">
|
||||
<p>:root appears, :import appears</p>
|
||||
<p>the next paragraph should appear</p>
|
||||
::import
|
||||
<p>even though it's an import directive, but if we use the full syntax <code>::directive-name{attr="name" attr2="a/path"}</code></p>
|
||||
<p>it goes.</p>
|
||||
<p>::: name [inline-content] {key=val}
|
||||
a container directive
|
||||
:::</p>
|
||||
</section>",
|
||||
"solutions": [],
|
||||
"tests": [],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`challenge parser > should parse a more realistic md file 1`] = `
|
||||
{
|
||||
"assignments": [],
|
||||
@@ -710,3 +615,98 @@ if(let x of xs) {
|
||||
],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`challenge parser > should parse md with a scene 1`] = `
|
||||
{
|
||||
"assignments": [],
|
||||
"description": "<section id="description">
|
||||
<p>This challenge has a scene.</p>
|
||||
</section>",
|
||||
"scene": {
|
||||
"commands": [
|
||||
{
|
||||
"character": "Maria",
|
||||
"opacity": 1,
|
||||
"startTime": 0,
|
||||
},
|
||||
{
|
||||
"character": "Maria",
|
||||
"dialogue": {
|
||||
"align": "center",
|
||||
"text": "I'm Maria, the team lead.",
|
||||
},
|
||||
"finishTime": 2.4,
|
||||
"startTime": 0.7,
|
||||
},
|
||||
{
|
||||
"character": "Maria",
|
||||
"opacity": 0,
|
||||
"startTime": 3.4,
|
||||
},
|
||||
],
|
||||
"setup": {
|
||||
"audio": {
|
||||
"filename": "1.1-1.mp3",
|
||||
"finishTimestamp": 4,
|
||||
"startTime": 1,
|
||||
"startTimestamp": 2.6,
|
||||
},
|
||||
"background": "company2-center.png",
|
||||
"characters": [
|
||||
{
|
||||
"character": "Maria",
|
||||
"opacity": 0,
|
||||
"position": {
|
||||
"x": 50,
|
||||
"y": 0,
|
||||
"z": 1.5,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
"solutions": [],
|
||||
"tests": [],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`challenge parser > should parse video questions 1`] = `
|
||||
{
|
||||
"assignments": [],
|
||||
"description": "<section id="description">
|
||||
<p>Paragraph 1</p>
|
||||
<pre><code class="language-html">code example
|
||||
</code></pre>
|
||||
</section>",
|
||||
"instructions": "<section id="instructions">
|
||||
<p>Paragraph 0</p>
|
||||
<pre><code class="language-html">code example 0
|
||||
</code></pre>
|
||||
</section>",
|
||||
"questions": [
|
||||
{
|
||||
"answers": [
|
||||
{
|
||||
"answer": "<p>Some inline <code>code</code></p>",
|
||||
"feedback": "<p>That is not correct.</p>",
|
||||
},
|
||||
{
|
||||
"answer": "<p>Some <em>italics</em></p>
|
||||
<p>A second answer paragraph.</p>",
|
||||
"feedback": null,
|
||||
},
|
||||
{
|
||||
"answer": "<p><code> code in </code> code tags</p>",
|
||||
"feedback": null,
|
||||
},
|
||||
],
|
||||
"solution": 3,
|
||||
"text": "<p>Question line 1</p>
|
||||
<pre><code class="language-js"> var x = 'y';
|
||||
</code></pre>",
|
||||
},
|
||||
],
|
||||
"solutions": [],
|
||||
"tests": [],
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -45,21 +45,21 @@ describe('challenge parser', () => {
|
||||
expect(parsed).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('it should parse video questions', async () => {
|
||||
it('should parse video questions', async () => {
|
||||
const parsed = await parseMD(
|
||||
resolve(__dirname, '__fixtures__/with-video-question.md')
|
||||
);
|
||||
expect(parsed).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('it should not parse directives we do not use', async () => {
|
||||
it('should not parse directives we do not use', async () => {
|
||||
const parsed = await parseMD(
|
||||
resolve(__dirname, '__fixtures__/with-directives.md')
|
||||
);
|
||||
expect(parsed).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('it should parse md with a scene', async () => {
|
||||
it('should parse md with a scene', async () => {
|
||||
const parsed = await parseMD(resolve(__dirname, '__fixtures__/scene.md'));
|
||||
expect(parsed).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -272,29 +272,6 @@ const Button = () => {
|
||||
};`);
|
||||
});
|
||||
|
||||
/* Revisit this once we've decided what to do about multifile imports. I
|
||||
think the best approach is likely to be use the following format for .files
|
||||
|
||||
it('combines all the code of a specific language into a single file', () => {
|
||||
|
||||
{ css: [css files],
|
||||
html: [html files],
|
||||
...
|
||||
}
|
||||
|
||||
or
|
||||
|
||||
{ css: {css files},
|
||||
html: {html files},
|
||||
...
|
||||
}
|
||||
|
||||
depending on what's easier to work with in graphQL
|
||||
|
||||
});
|
||||
|
||||
*/
|
||||
|
||||
it('should throw an error if a seed has no contents', () => {
|
||||
expect.assertions(1);
|
||||
expect(() => plugin(withEmptyContentsAST, file)).toThrow(
|
||||
|
||||
@@ -64,9 +64,11 @@ describe('replace-imports', () => {
|
||||
it('should proceed when the imported file exists', async () => {
|
||||
const plugin = addImports();
|
||||
|
||||
await new Promise(resolve => {
|
||||
plugin(importsAST, correctFile, resolve);
|
||||
});
|
||||
await expect(
|
||||
new Promise(resolve => {
|
||||
plugin(importsAST, correctFile, resolve);
|
||||
})
|
||||
).resolves.toBeUndefined();
|
||||
});
|
||||
|
||||
it('should fail when the imported file cannot be found', async () => {
|
||||
|
||||
Reference in New Issue
Block a user