chore(deps): update jest monorepo to v29 (major) (#49775)

* chore(deps): update jest monorepo to v29

* chore: install jest-environment-jsdom

* chore: update snapshots

* fix: update config to transform nanoid+uuid

* chore: update babel's node target

This does not seem strictly necessary, but is probably for the best.

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
renovate[bot]
2023-03-21 12:37:23 +00:00
committed by GitHub
parent 3dab4261fb
commit 7ecf6a44bc
19 changed files with 838 additions and 621 deletions

View File

@@ -147,7 +147,7 @@
"@types/chai": "^4.3.4",
"@types/enzyme": "^3.10.12",
"@types/enzyme-adapter-react-16": "1.0.6",
"@types/jest": "27.5.2",
"@types/jest": "29.5.0",
"@types/jquery": "^3.5.16",
"@types/loadable__component": "5.13.4",
"@types/lodash-es": "^4.17.6",
@@ -178,6 +178,7 @@
"core-js": "2.6.12",
"dotenv": "16.0.3",
"gatsby-plugin-webpack-bundle-analyser-v2": "1.1.30",
"jest-environment-jsdom": "29.5.0",
"jest-json-schema-extended": "1.0.1",
"monaco-editor-webpack-plugin": "4.2.0",
"react-test-renderer": "16.14.0",

View File

@@ -374,7 +374,7 @@ exports[`should check certification page consistency 1`] = `
<li
className="timeline-pagination_list_item"
style={
Object {
{
"visibility": "hidden",
}
}
@@ -390,7 +390,7 @@ exports[`should check certification page consistency 1`] = `
<li
className="timeline-pagination_list_item"
style={
Object {
{
"visibility": "hidden",
}
}
@@ -411,7 +411,7 @@ exports[`should check certification page consistency 1`] = `
<li
className="timeline-pagination_list_item"
style={
Object {
{
"visibility": "unset",
}
}
@@ -427,7 +427,7 @@ exports[`should check certification page consistency 1`] = `
<li
className="timeline-pagination_list_item"
style={
Object {
{
"visibility": "unset",
}
}

View File

@@ -36,7 +36,7 @@ exports[`<Honesty /> <Honesty /> snapshot when isHonest is false: Honesty 1`] =
<a
href="mailto:support@freecodecamp.org"
>
Object {
{
"email": "support@freecodecamp.org",
}
</a>
@@ -94,7 +94,7 @@ exports[`<Honesty /> <Honesty /> snapshot when isHonest is true: HonestyAccepted
<a
href="mailto:support@freecodecamp.org"
>
Object {
{
"email": "support@freecodecamp.org",
}
</a>

View File

@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should check certification button consistency 1`] = `
Array [
[
<div
className="row"
>
@@ -11,7 +11,7 @@ Array [
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -151,7 +151,7 @@ Array [
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -291,7 +291,7 @@ Array [
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -431,7 +431,7 @@ Array [
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -571,7 +571,7 @@ Array [
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -711,7 +711,7 @@ Array [
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -851,7 +851,7 @@ Array [
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -991,7 +991,7 @@ Array [
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -1131,7 +1131,7 @@ Array [
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -1271,7 +1271,7 @@ Array [
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -1411,7 +1411,7 @@ Array [
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -1546,7 +1546,7 @@ Array [
`;
exports[`should check legacy certification button consistency 1`] = `
Array [
[
<div
className="row"
>
@@ -1556,7 +1556,7 @@ Array [
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -1776,7 +1776,7 @@ Array [
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -1996,7 +1996,7 @@ Array [
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -2216,7 +2216,7 @@ Array [
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}

View File

@@ -15,7 +15,7 @@ exports[`<EmailSignUp /> Non-Authenticated user "not accepted terms and conditio
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -30,7 +30,7 @@ exports[`<EmailSignUp /> Non-Authenticated user "not accepted terms and conditio
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -99,7 +99,7 @@ exports[`<EmailSignUp /> Non-Authenticated user "not accepted terms and conditio
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -111,7 +111,7 @@ exports[`<EmailSignUp /> Non-Authenticated user "not accepted terms and conditio
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}
@@ -124,7 +124,7 @@ exports[`<EmailSignUp /> Non-Authenticated user "not accepted terms and conditio
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "5px 0",
}
@@ -141,7 +141,7 @@ exports[`<EmailSignUp /> Non-Authenticated user "not accepted terms and conditio
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "5px 0",
}
@@ -154,7 +154,7 @@ exports[`<EmailSignUp /> Non-Authenticated user "not accepted terms and conditio
<div
className="spacer"
style={
Object {
{
"height": "1px",
"padding": "15px 0",
}

View File

@@ -19,7 +19,7 @@ module.exports = {
'^.+\\.[jt]sx?$': '<rootDir>/jest.transform.js'
},
roots: ['.', './client', './api-server'],
transformIgnorePatterns: ['node_modules/(?!(gatsby)/)'],
transformIgnorePatterns: ['node_modules/.pnpm/(?!(nanoid|uuid)@)'],
setupFilesAfterEnv: ['./jest.setup.js'],
testEnvironment: 'jsdom'
};

View File

@@ -4,7 +4,7 @@ const babelOptions = {
'@babel/preset-env',
{
targets: {
node: 14
node: 18
}
}
],

View File

@@ -109,7 +109,7 @@
"@testing-library/dom": "8.20.0",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/user-event": "13.5.0",
"@types/jest": "27.5.2",
"@types/jest": "29.5.0",
"@types/lodash": "4.14.191",
"@types/node": "18.15.3",
"@types/store": "2.0.2",
@@ -133,7 +133,7 @@
"eslint-plugin-testing-library": "4.12.4",
"execa": "5.1.1",
"husky": "8.0.3",
"jest": "27.5.1",
"jest": "29.5.0",
"js-yaml": "3.14.1",
"lint-staged": "^13.1.0",
"lodash": "4.17.21",

566
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,38 +1,38 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`challenge parser it should not parse directives we do not use 1`] = `
Object {
"assignments": Array [],
"description": "<section id=\\"description\\">
{
"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>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": Array [],
"tests": Array [],
"solutions": [],
"tests": [],
}
`;
exports[`challenge parser it should parse video questions 1`] = `
Object {
"assignments": Array [],
"description": "<section id=\\"description\\">
{
"assignments": [],
"description": "<section id="description">
<p>Paragraph 1</p>
<pre><code class=\\"language-html\\">code example
<pre><code class="language-html">code example
</code></pre>
</section>",
"instructions": "<section id=\\"instructions\\">
"instructions": "<section id="instructions">
<p>Paragraph 0</p>
<pre><code class=\\"language-html\\">code example 0
<pre><code class="language-html">code example 0
</code></pre>
</section>",
"question": Object {
"answers": Array [
"question": {
"answers": [
"<p>Some inline <code>code</code></p>",
"<p>Some <em>italics</em></p>
<p>A second answer paragraph.</p>",
@@ -40,48 +40,48 @@ Object {
],
"solution": 3,
"text": "<p>Question line 1</p>
<pre><code class=\\"language-js\\"> var x = 'y';
<pre><code class="language-js"> var x = 'y';
</code></pre>",
},
"solutions": Array [],
"tests": Array [],
"solutions": [],
"tests": [],
}
`;
exports[`challenge parser should import md from other files 1`] = `
Object {
"assignments": Array [],
"challengeFiles": Array [
Object {
{
"assignments": [],
"challengeFiles": [
{
"contents": "<html>
<body>
</body>
</html>",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "html",
"head": "",
"id": "",
"name": "index",
"tail": "",
},
Object {
{
"contents": "body {
background: green;
}",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "css",
"head": "",
"id": "",
"name": "styles",
"tail": "",
},
Object {
{
"contents": "var x = 'y';
for (let index = 0; index < array.length; index++) {
const element = array[index];
// imported from script.md
}",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "js",
"head": "",
"id": "custom-name",
@@ -89,23 +89,23 @@ for (let index = 0; index < array.length; index++) {
"tail": "",
},
],
"description": "<section id=\\"description\\">
"description": "<section id="description">
<p>Paragraph 1</p>
<pre><code class=\\"language-html\\">code example
<pre><code class="language-html">code example
</code></pre>
</section>",
"instructions": "<section id=\\"instructions\\">
"instructions": "<section id="instructions">
<p>Paragraph 0</p>
<pre><code class=\\"language-html\\">code example 0
<pre><code class="language-html">code example 0
</code></pre>
</section>",
"solutions": Array [],
"tests": Array [
Object {
"solutions": [],
"tests": [
{
"testString": "// test code",
"text": "<p>First hint</p>",
},
Object {
{
"testString": "// more test code",
"text": "<p>Second hint with <code>code</code></p>",
},
@@ -114,35 +114,35 @@ for (let index = 0; index < array.length; index++) {
`;
exports[`challenge parser should not mix other YAML with the frontmatter 1`] = `
Object {
"assignments": Array [],
"challengeFiles": Array [
Object {
{
"assignments": [],
"challengeFiles": [
{
"contents": "<html>
<body>
</body>
</html>",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "html",
"head": "",
"id": "",
"name": "index",
"tail": "",
},
Object {
{
"contents": "body {
background: green;
}",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "css",
"head": "",
"id": "",
"name": "styles",
"tail": "",
},
Object {
{
"contents": "var x = 'y';",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "js",
"head": "",
"id": "",
@@ -150,27 +150,27 @@ Object {
"tail": "",
},
],
"description": "<section id=\\"description\\">
"description": "<section id="description">
<p>Paragraph 1</p>
<pre><code class=\\"language-html\\">code example
<pre><code class="language-html">code example
</code></pre>
<pre><code class=\\"language-yaml\\">key:
<pre><code class="language-yaml">key:
- subkey: value
anothersubkey: another value
</code></pre>
</section>",
"instructions": "<section id=\\"instructions\\">
"instructions": "<section id="instructions">
<p>Paragraph 0</p>
<pre><code class=\\"language-html\\">code example 0
<pre><code class="language-html">code example 0
</code></pre>
</section>",
"solutions": Array [],
"tests": Array [
Object {
"solutions": [],
"tests": [
{
"testString": "// test code",
"text": "<p>First hint</p>",
},
Object {
{
"testString": "// more test code",
"text": "<p>Second hint with <code>code</code></p>",
},
@@ -179,10 +179,10 @@ Object {
`;
exports[`challenge parser should parse a more realistic md file 1`] = `
Object {
"assignments": Array [],
"challengeFiles": Array [
Object {
{
"assignments": [],
"challengeFiles": [
{
"contents": "<html>
<body>
<h1>CatPhotoApp</h1>
@@ -192,14 +192,14 @@ Object {
<!-- TODO: Add link to cat photos -->
<p>
Click here to view more
<a target=\\"_blank\\" href=\\"https://www.freecodecamp.org/cat-photos\\"
<a target="_blank" href="https://www.freecodecamp.org/cat-photos"
>cat photos</a
>.
</p>
<a href=\\"https://www.freecodecamp.org/cat-photos\\"
<a href="https://www.freecodecamp.org/cat-photos"
><img
src=\\"https://bit.ly/fcc-relaxing-cat\\"
alt=\\"A cute orange cat lying on its back.\\"
src="https://bit.ly/fcc-relaxing-cat"
alt="A cute orange cat lying on its back."
/></a>
</section>
<section>
@@ -208,7 +208,7 @@ Object {
</main>
</body>
</html>",
"editableRegionBoundaries": Array [
"editableRegionBoundaries": [
19,
23,
],
@@ -218,7 +218,7 @@ Object {
"name": "index",
"tail": "",
},
Object {
{
"contents": "body {
background: white;
}
@@ -231,7 +231,7 @@ h1 {
a {
color: green;
}",
"editableRegionBoundaries": Array [
"editableRegionBoundaries": [
7,
9,
],
@@ -241,9 +241,9 @@ a {
"name": "styles",
"tail": "",
},
Object {
{
"contents": "var x = 'y';",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "js",
"head": " // this runs before the user's code is evaluated.",
"id": "final-key",
@@ -251,7 +251,7 @@ a {
"tail": "",
},
],
"description": "<section id=\\"description\\">
"description": "<section id="description">
<p>When you add a lower rank heading element to the page, it's implied that you're starting a new subsection.</p>
<p>After the last <code>h2</code> element of the second <code>section</code> element, add an <code>h3</code> element with the text <code>Things cats love:</code>.</p>
<blockquote>
@@ -261,14 +261,14 @@ a {
</p>
</blockquote>
</section>",
"instructions": "<section id=\\"instructions\\">
"instructions": "<section id="instructions">
<p>Do something with the <code>code</code>.</p>
<p>To test that adjacent tags are handled correctly:</p>
<p>a bit of <code>code</code> <tag>with more after a space</tag> and another pair of <strong>elements</strong> <em>with a space</em></p>
</section>",
"solutions": Array [
Array [
Object {
"solutions": [
[
{
"contents": "<html>
<body>
<h1>CatPhotoApp</h1>
@@ -278,14 +278,14 @@ a {
<!-- TODO: Add link to cat photos -->
<p>
Click here to view more
<a target=\\"_blank\\" href=\\"https://www.freecodecamp.org/cat-photos\\"
<a target="_blank" href="https://www.freecodecamp.org/cat-photos"
>cat photos</a
>.
</p>
<a href=\\"https://www.freecodecamp.org/cat-photos\\"
<a href="https://www.freecodecamp.org/cat-photos"
><img
src=\\"https://bit.ly/fcc-relaxing-cat\\"
alt=\\"A cute orange cat lying on its back.\\"
src="https://bit.ly/fcc-relaxing-cat"
alt="A cute orange cat lying on its back."
/></a>
</section>
<section>
@@ -300,7 +300,7 @@ a {
"name": "index",
"tail": "",
},
Object {
{
"contents": "body {
background: white;
}
@@ -319,7 +319,7 @@ a {
"name": "styles",
"tail": "",
},
Object {
{
"contents": "var x = 'y';",
"ext": "js",
"head": "",
@@ -329,38 +329,38 @@ a {
},
],
],
"tests": Array [
Object {
"tests": [
{
"testString": "assert(
document.querySelectorAll('main > section')[1] &&
code.match(/\\\\<\\\\/section>/g).length == 2
code.match(/\\<\\/section>/g).length == 2
);",
"text": "<p>The second <code>section</code> element appears to be missing or does not have both an opening and closing tag.</p>",
},
Object {
{
"testString": "assert(
document.querySelectorAll('main > section')[1].lastElementChild.nodeName ===
'H3'
);",
"text": "<p>There should be an <code>h3</code> element right above the second <code>section</code> element's closing tag.</p>",
},
Object {
{
"testString": "assert(
document
.querySelectorAll('main > section')[1]
.lastElementChild.innerText.toLowerCase()
.replace(/\\\\s+/g, ' ') === 'things cats love:'
.replace(/\\s+/g, ' ') === 'things cats love:'
);",
"text": "<p>The <code>h3</code> element right above the second <code>section</code> element's closing tag should have the text <code>Things cats love:</code>. Make sure to include the colon at the end of the text.</p>",
},
Object {
{
"testString": "const secondSectionLastElemNode = document.querySelectorAll('main > section')[1]
.lastElementChild;
assert(
secondSectionLastElemNode.nodeName === 'H3' &&
secondSectionLastElemNode.previousElementSibling.innerText
.toLowerCase()
.replace(/\\\\s+/g, ' ') === 'cat lists'
.replace(/\\s+/g, ' ') === 'cat lists'
);",
"text": "<p>There should be an <code>h2</code> element with the text <code>Cat Lists</code> above the last <code>h3</code> element that is nested in the last <code>section</code> element'. You may have accidentally deleted the <code>h2</code> element.</p>",
},
@@ -369,35 +369,35 @@ assert(
`;
exports[`challenge parser should parse a simple md file 1`] = `
Object {
"assignments": Array [],
"challengeFiles": Array [
Object {
{
"assignments": [],
"challengeFiles": [
{
"contents": "<html>
<body>
</body>
</html>",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "html",
"head": "",
"id": "",
"name": "index",
"tail": "",
},
Object {
{
"contents": "body {
background: green;
}",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "css",
"head": "",
"id": "",
"name": "styles",
"tail": "",
},
Object {
{
"contents": "var x = 'y';",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "js",
"head": "",
"id": "",
@@ -405,19 +405,19 @@ Object {
"tail": "",
},
],
"description": "<section id=\\"description\\">
"description": "<section id="description">
<p>Paragraph 1</p>
<pre><code class=\\"language-html\\">code example
<pre><code class="language-html">code example
</code></pre>
</section>",
"instructions": "<section id=\\"instructions\\">
"instructions": "<section id="instructions">
<p>Paragraph 0</p>
<pre><code class=\\"language-html\\">code example 0
<pre><code class="language-html">code example 0
</code></pre>
</section>",
"solutions": Array [
Array [
Object {
"solutions": [
[
{
"contents": "<html>
<body>
</body>
@@ -428,7 +428,7 @@ Object {
"name": "index",
"tail": "",
},
Object {
{
"contents": "body {
background: white;
}",
@@ -438,7 +438,7 @@ Object {
"name": "styles",
"tail": "",
},
Object {
{
"contents": "var x = 'y';
\`\`",
"ext": "js",
@@ -449,16 +449,16 @@ Object {
},
],
],
"tests": Array [
Object {
"tests": [
{
"testString": "// test code",
"text": "<p>First hint</p>",
},
Object {
{
"testString": "// more test code",
"text": "<p>Second hint with <code>code</code></p>",
},
Object {
{
"testString": "// more test code
if(let x of xs) {
console.log(x);
@@ -470,35 +470,35 @@ if(let x of xs) {
`;
exports[`challenge parser should parse frontmatter 1`] = `
Object {
"assignments": Array [],
"challengeFiles": Array [
Object {
{
"assignments": [],
"challengeFiles": [
{
"contents": "<html>
<body>
</body>
</html>",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "html",
"head": "",
"id": "",
"name": "index",
"tail": "",
},
Object {
{
"contents": "body {
background: green;
}",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "css",
"head": "",
"id": "",
"name": "styles",
"tail": "",
},
Object {
{
"contents": "var x = 'y';",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "js",
"head": "",
"id": "",
@@ -507,21 +507,21 @@ Object {
},
],
"challengeType": 0,
"description": "<section id=\\"description\\">
"description": "<section id="description">
<p>Paragraph 1</p>
<pre><code class=\\"language-html\\">code example
<pre><code class="language-html">code example
</code></pre>
</section>",
"forumTopicId": 18276,
"id": "bd7123c8c441eddfaeb5bdef",
"isHidden": false,
"solutions": Array [],
"tests": Array [
Object {
"solutions": [],
"tests": [
{
"testString": "// test code",
"text": "<p>First hint</p>",
},
Object {
{
"testString": "// more test code",
"text": "<p>Second hint with <code>code</code></p>",
},
@@ -532,35 +532,35 @@ Object {
`;
exports[`challenge parser should parse gfm strikethrough and frontmatter 1`] = `
Object {
"assignments": Array [],
"challengeFiles": Array [
Object {
{
"assignments": [],
"challengeFiles": [
{
"contents": "<html>
<body>
</body>
</html>",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "html",
"head": "",
"id": "",
"name": "index",
"tail": "",
},
Object {
{
"contents": "body {
background: green;
}",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "css",
"head": "",
"id": "",
"name": "styles",
"tail": "",
},
Object {
{
"contents": "var x = 'y';",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "js",
"head": "",
"id": "",
@@ -568,9 +568,9 @@ Object {
"tail": "",
},
],
"description": "<section id=\\"description\\">
"description": "<section id="description">
<p>Paragraph 1 <del>Strikethrough text</del>. https://should.not.be.autolinked</p>
<pre><code class=\\"language-html\\">code example
<pre><code class="language-html">code example
</code></pre>
<table>
<thead>
@@ -587,14 +587,14 @@ Object {
</tbody>
</table>
</section>",
"instructions": "<section id=\\"instructions\\">
"instructions": "<section id="instructions">
<p>Paragraph 0</p>
<pre><code class=\\"language-html\\">code example 0
<pre><code class="language-html">code example 0
</code></pre>
</section>",
"solutions": Array [
Array [
Object {
"solutions": [
[
{
"contents": "<html>
<body>
</body>
@@ -605,7 +605,7 @@ Object {
"name": "index",
"tail": "",
},
Object {
{
"contents": "body {
background: white;
}",
@@ -615,7 +615,7 @@ Object {
"name": "styles",
"tail": "",
},
Object {
{
"contents": "var x = 'y';
\`\`",
"ext": "js",
@@ -626,16 +626,16 @@ Object {
},
],
],
"tests": Array [
Object {
"tests": [
{
"testString": "// test code",
"text": "<p>First hint</p>",
},
Object {
{
"testString": "// more test code",
"text": "<p>Second hint with <code>code</code></p>",
},
Object {
{
"testString": "// more test code
if(let x of xs) {
console.log(x);

View File

@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`process-frontmatter plugin should have an output to match the snapshot 1`] = `
Object {
{
"challengeType": 0,
"forumTopicId": 18276,
"id": "bd7123c8c441eddfaeb5bdef",

View File

@@ -1,34 +1,34 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`add-seed plugin should have an output to match the snapshot 1`] = `
Object {
"challengeFiles": Array [
Object {
{
"challengeFiles": [
{
"contents": "<html>
<body>
</body>
</html>",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "html",
"head": "",
"id": "",
"name": "index",
"tail": "",
},
Object {
{
"contents": "body {
background: green;
}",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "css",
"head": "",
"id": "",
"name": "styles",
"tail": "",
},
Object {
{
"contents": "var x = 'y';",
"editableRegionBoundaries": Array [],
"editableRegionBoundaries": [],
"ext": "js",
"head": "",
"id": "",

View File

@@ -1,10 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`add solution plugin should have an output to match the snapshot 1`] = `
Object {
"solutions": Array [
Array [
Object {
{
"solutions": [
[
{
"contents": "<html>
<body>
</body>
@@ -15,7 +15,7 @@ Object {
"name": "index",
"tail": "",
},
Object {
{
"contents": "body {
background: white;
}",
@@ -25,7 +25,7 @@ Object {
"name": "styles",
"tail": "",
},
Object {
{
"contents": "var x = 'y';
\`\`",
"ext": "js",

View File

@@ -1,17 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`add-tests plugin should have an output to match the snapshot 1`] = `
Object {
"tests": Array [
Object {
{
"tests": [
{
"testString": "// test code",
"text": "<p>First hint</p>",
},
Object {
{
"testString": "// more test code",
"text": "<p>Second hint with <code>code</code></p>",
},
Object {
{
"testString": "// more test code
if(let x of xs) {
console.log(x);

View File

@@ -1,15 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`add-text should have an output to match the snapshot 1`] = `
Object {
"description": "<section id=\\"description\\">
{
"description": "<section id="description">
<p>Paragraph 1</p>
<pre><code class=\\"language-html\\">code example
<pre><code class="language-html">code example
</code></pre>
</section>",
"instructions": "<section id=\\"instructions\\">
"instructions": "<section id="instructions">
<p>Paragraph 0</p>
<pre><code class=\\"language-html\\">code example 0
<pre><code class="language-html">code example 0
</code></pre>
</section>",
}

View File

@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`add-video-question plugin should match the video snapshot 1`] = `
Object {
"question": Object {
"answers": Array [
{
"question": {
"answers": [
"<p>Some inline <code>code</code></p>",
"<p>Some <em>italics</em></p>
<p>A second answer paragraph.</p>",
@@ -11,7 +11,7 @@ Object {
],
"solution": 3,
"text": "<p>Question line 1</p>
<pre><code class=\\"language-js\\"> var x = 'y';
<pre><code class="language-js"> var x = 'y';
</code></pre>",
},
}

View File

@@ -1,18 +1,18 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`replace-imports should have an output to match the snapshot 1`] = `
Object {
"children": Array [
Object {
"children": Array [
Object {
"position": Object {
"end": Object {
{
"children": [
{
"children": [
{
"position": {
"end": {
"column": 18,
"line": 3,
"offset": 68,
},
"start": Object {
"start": {
"column": 3,
"line": 3,
"offset": 53,
@@ -23,13 +23,13 @@ Object {
},
],
"depth": 1,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 18,
"line": 3,
"offset": 68,
},
"start": Object {
"start": {
"column": 1,
"line": 3,
"offset": 51,
@@ -37,16 +37,16 @@ Object {
},
"type": "heading",
},
Object {
"children": Array [
Object {
"position": Object {
"end": Object {
{
"children": [
{
"position": {
"end": {
"column": 12,
"line": 5,
"offset": 81,
},
"start": Object {
"start": {
"column": 1,
"line": 5,
"offset": 70,
@@ -56,13 +56,13 @@ Object {
"value": "Paragraph 1",
},
],
"position": Object {
"end": Object {
"position": {
"end": {
"column": 12,
"line": 5,
"offset": 81,
},
"start": Object {
"start": {
"column": 1,
"line": 5,
"offset": 70,
@@ -70,16 +70,16 @@ Object {
},
"type": "paragraph",
},
Object {
{
"lang": "html",
"meta": null,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 4,
"line": 9,
"offset": 107,
},
"start": Object {
"start": {
"column": 1,
"line": 7,
"offset": 83,
@@ -88,16 +88,16 @@ Object {
"type": "code",
"value": "code example",
},
Object {
"children": Array [
Object {
"position": Object {
"end": Object {
{
"children": [
{
"position": {
"end": {
"column": 19,
"line": 11,
"offset": 127,
},
"start": Object {
"start": {
"column": 3,
"line": 11,
"offset": 111,
@@ -108,13 +108,13 @@ Object {
},
],
"depth": 1,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 19,
"line": 11,
"offset": 127,
},
"start": Object {
"start": {
"column": 1,
"line": 11,
"offset": 109,
@@ -122,16 +122,16 @@ Object {
},
"type": "heading",
},
Object {
"children": Array [
Object {
"position": Object {
"end": Object {
{
"children": [
{
"position": {
"end": {
"column": 12,
"line": 13,
"offset": 140,
},
"start": Object {
"start": {
"column": 1,
"line": 13,
"offset": 129,
@@ -141,13 +141,13 @@ Object {
"value": "Paragraph 0",
},
],
"position": Object {
"end": Object {
"position": {
"end": {
"column": 12,
"line": 13,
"offset": 140,
},
"start": Object {
"start": {
"column": 1,
"line": 13,
"offset": 129,
@@ -155,16 +155,16 @@ Object {
},
"type": "paragraph",
},
Object {
{
"lang": "html",
"meta": null,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 4,
"line": 17,
"offset": 168,
},
"start": Object {
"start": {
"column": 1,
"line": 15,
"offset": 142,
@@ -173,16 +173,16 @@ Object {
"type": "code",
"value": "code example 0",
},
Object {
"children": Array [
Object {
"position": Object {
"end": Object {
{
"children": [
{
"position": {
"end": {
"column": 12,
"line": 19,
"offset": 181,
},
"start": Object {
"start": {
"column": 3,
"line": 19,
"offset": 172,
@@ -193,13 +193,13 @@ Object {
},
],
"depth": 1,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 12,
"line": 19,
"offset": 181,
},
"start": Object {
"start": {
"column": 1,
"line": 19,
"offset": 170,
@@ -207,16 +207,16 @@ Object {
},
"type": "heading",
},
Object {
"children": Array [
Object {
"position": Object {
"end": Object {
{
"children": [
{
"position": {
"end": {
"column": 11,
"line": 21,
"offset": 193,
},
"start": Object {
"start": {
"column": 1,
"line": 21,
"offset": 183,
@@ -226,13 +226,13 @@ Object {
"value": "First hint",
},
],
"position": Object {
"end": Object {
"position": {
"end": {
"column": 11,
"line": 21,
"offset": 193,
},
"start": Object {
"start": {
"column": 1,
"line": 21,
"offset": 183,
@@ -240,16 +240,16 @@ Object {
},
"type": "paragraph",
},
Object {
{
"lang": "js",
"meta": null,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 4,
"line": 25,
"offset": 217,
},
"start": Object {
"start": {
"column": 1,
"line": 23,
"offset": 195,
@@ -258,16 +258,16 @@ Object {
"type": "code",
"value": "// test code",
},
Object {
"children": Array [
Object {
"position": Object {
"end": Object {
{
"children": [
{
"position": {
"end": {
"column": 18,
"line": 27,
"offset": 236,
},
"start": Object {
"start": {
"column": 1,
"line": 27,
"offset": 219,
@@ -276,14 +276,14 @@ Object {
"type": "text",
"value": "Second hint with ",
},
Object {
"position": Object {
"end": Object {
{
"position": {
"end": {
"column": 24,
"line": 27,
"offset": 242,
},
"start": Object {
"start": {
"column": 18,
"line": 27,
"offset": 236,
@@ -292,14 +292,14 @@ Object {
"type": "html",
"value": "<code>",
},
Object {
"position": Object {
"end": Object {
{
"position": {
"end": {
"column": 28,
"line": 27,
"offset": 246,
},
"start": Object {
"start": {
"column": 24,
"line": 27,
"offset": 242,
@@ -308,14 +308,14 @@ Object {
"type": "text",
"value": "code",
},
Object {
"position": Object {
"end": Object {
{
"position": {
"end": {
"column": 35,
"line": 27,
"offset": 253,
},
"start": Object {
"start": {
"column": 28,
"line": 27,
"offset": 246,
@@ -325,13 +325,13 @@ Object {
"value": "</code>",
},
],
"position": Object {
"end": Object {
"position": {
"end": {
"column": 35,
"line": 27,
"offset": 253,
},
"start": Object {
"start": {
"column": 1,
"line": 27,
"offset": 219,
@@ -339,16 +339,16 @@ Object {
},
"type": "paragraph",
},
Object {
{
"lang": "js",
"meta": null,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 4,
"line": 31,
"offset": 282,
},
"start": Object {
"start": {
"column": 1,
"line": 29,
"offset": 255,
@@ -357,16 +357,16 @@ Object {
"type": "code",
"value": "// more test code",
},
Object {
"children": Array [
Object {
"position": Object {
"end": Object {
{
"children": [
{
"position": {
"end": {
"column": 11,
"line": 34,
"offset": 295,
},
"start": Object {
"start": {
"column": 3,
"line": 34,
"offset": 287,
@@ -377,13 +377,13 @@ Object {
},
],
"depth": 1,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 11,
"line": 34,
"offset": 295,
},
"start": Object {
"start": {
"column": 1,
"line": 34,
"offset": 285,
@@ -391,16 +391,16 @@ Object {
},
"type": "heading",
},
Object {
"children": Array [
Object {
"position": Object {
"end": Object {
{
"children": [
{
"position": {
"end": {
"column": 21,
"line": 36,
"offset": 317,
},
"start": Object {
"start": {
"column": 4,
"line": 36,
"offset": 300,
@@ -411,13 +411,13 @@ Object {
},
],
"depth": 2,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 21,
"line": 36,
"offset": 317,
},
"start": Object {
"start": {
"column": 1,
"line": 36,
"offset": 297,
@@ -425,16 +425,16 @@ Object {
},
"type": "heading",
},
Object {
{
"lang": "html",
"meta": null,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 4,
"line": 43,
"offset": 364,
},
"start": Object {
"start": {
"column": 1,
"line": 38,
"offset": 319,
@@ -446,16 +446,16 @@ Object {
</body>
</html>",
},
Object {
{
"lang": "css",
"meta": null,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 4,
"line": 49,
"offset": 406,
},
"start": Object {
"start": {
"column": 1,
"line": 45,
"offset": 366,
@@ -466,17 +466,17 @@ Object {
background: green;
}",
},
Object {
"children": Array [
Object {
{
"children": [
{
"alt": "custom-name",
"position": Object {
"end": Object {
"position": {
"end": {
"column": 17,
"line": 51,
"offset": 424,
},
"start": Object {
"start": {
"column": 1,
"line": 51,
"offset": 408,
@@ -487,13 +487,13 @@ Object {
"url": "",
},
],
"position": Object {
"end": Object {
"position": {
"end": {
"column": 17,
"line": 51,
"offset": 424,
},
"start": Object {
"start": {
"column": 1,
"line": 51,
"offset": 408,
@@ -501,16 +501,16 @@ Object {
},
"type": "paragraph",
},
Object {
{
"lang": "js",
"meta": null,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 4,
"line": 55,
"offset": 448,
},
"start": Object {
"start": {
"column": 1,
"line": 53,
"offset": 426,
@@ -519,16 +519,16 @@ Object {
"type": "code",
"value": "var x = 'y';",
},
Object {
{
"lang": "js",
"meta": null,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 4,
"line": 6,
"offset": 125,
},
"start": Object {
"start": {
"column": 1,
"line": 1,
"offset": 0,
@@ -541,13 +541,13 @@ Object {
}",
},
],
"position": Object {
"end": Object {
"position": {
"end": {
"column": 1,
"line": 58,
"offset": 476,
},
"start": Object {
"start": {
"column": 1,
"line": 1,
"offset": 0,

View File

@@ -1,17 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`between-headings should match the hints snapshot 1`] = `
Array [
Object {
"children": Array [
Object {
"position": Object {
"end": Object {
[
{
"children": [
{
"position": {
"end": {
"column": 11,
"line": 19,
"offset": 142,
},
"start": Object {
"start": {
"column": 1,
"line": 19,
"offset": 132,
@@ -21,13 +21,13 @@ Array [
"value": "First hint",
},
],
"position": Object {
"end": Object {
"position": {
"end": {
"column": 11,
"line": 19,
"offset": 142,
},
"start": Object {
"start": {
"column": 1,
"line": 19,
"offset": 132,
@@ -35,16 +35,16 @@ Array [
},
"type": "paragraph",
},
Object {
{
"lang": "js",
"meta": null,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 4,
"line": 23,
"offset": 166,
},
"start": Object {
"start": {
"column": 1,
"line": 21,
"offset": 144,
@@ -53,16 +53,16 @@ Array [
"type": "code",
"value": "// test code",
},
Object {
"children": Array [
Object {
"position": Object {
"end": Object {
{
"children": [
{
"position": {
"end": {
"column": 18,
"line": 25,
"offset": 185,
},
"start": Object {
"start": {
"column": 1,
"line": 25,
"offset": 168,
@@ -71,14 +71,14 @@ Array [
"type": "text",
"value": "Second hint with ",
},
Object {
"position": Object {
"end": Object {
{
"position": {
"end": {
"column": 24,
"line": 25,
"offset": 191,
},
"start": Object {
"start": {
"column": 18,
"line": 25,
"offset": 185,
@@ -87,14 +87,14 @@ Array [
"type": "html",
"value": "<code>",
},
Object {
"position": Object {
"end": Object {
{
"position": {
"end": {
"column": 28,
"line": 25,
"offset": 195,
},
"start": Object {
"start": {
"column": 24,
"line": 25,
"offset": 191,
@@ -103,14 +103,14 @@ Array [
"type": "text",
"value": "code",
},
Object {
"position": Object {
"end": Object {
{
"position": {
"end": {
"column": 35,
"line": 25,
"offset": 202,
},
"start": Object {
"start": {
"column": 28,
"line": 25,
"offset": 195,
@@ -120,13 +120,13 @@ Array [
"value": "</code>",
},
],
"position": Object {
"end": Object {
"position": {
"end": {
"column": 35,
"line": 25,
"offset": 202,
},
"start": Object {
"start": {
"column": 1,
"line": 25,
"offset": 168,
@@ -134,16 +134,16 @@ Array [
},
"type": "paragraph",
},
Object {
{
"lang": "js",
"meta": null,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 4,
"line": 29,
"offset": 231,
},
"start": Object {
"start": {
"column": 1,
"line": 27,
"offset": 204,
@@ -152,16 +152,16 @@ Array [
"type": "code",
"value": "// more test code",
},
Object {
"children": Array [
Object {
"position": Object {
"end": Object {
{
"children": [
{
"position": {
"end": {
"column": 7,
"line": 31,
"offset": 239,
},
"start": Object {
"start": {
"column": 1,
"line": 31,
"offset": 233,
@@ -170,16 +170,16 @@ Array [
"type": "text",
"value": "Third ",
},
Object {
"children": Array [
Object {
"position": Object {
"end": Object {
{
"children": [
{
"position": {
"end": {
"column": 12,
"line": 31,
"offset": 244,
},
"start": Object {
"start": {
"column": 8,
"line": 31,
"offset": 240,
@@ -189,13 +189,13 @@ Array [
"value": "hint",
},
],
"position": Object {
"end": Object {
"position": {
"end": {
"column": 13,
"line": 31,
"offset": 245,
},
"start": Object {
"start": {
"column": 7,
"line": 31,
"offset": 239,
@@ -203,14 +203,14 @@ Array [
},
"type": "emphasis",
},
Object {
"position": Object {
"end": Object {
{
"position": {
"end": {
"column": 19,
"line": 31,
"offset": 251,
},
"start": Object {
"start": {
"column": 13,
"line": 31,
"offset": 245,
@@ -219,14 +219,14 @@ Array [
"type": "text",
"value": " with ",
},
Object {
"position": Object {
"end": Object {
{
"position": {
"end": {
"column": 25,
"line": 31,
"offset": 257,
},
"start": Object {
"start": {
"column": 19,
"line": 31,
"offset": 251,
@@ -235,14 +235,14 @@ Array [
"type": "html",
"value": "<code>",
},
Object {
"position": Object {
"end": Object {
{
"position": {
"end": {
"column": 29,
"line": 31,
"offset": 261,
},
"start": Object {
"start": {
"column": 25,
"line": 31,
"offset": 257,
@@ -251,14 +251,14 @@ Array [
"type": "text",
"value": "code",
},
Object {
"position": Object {
"end": Object {
{
"position": {
"end": {
"column": 36,
"line": 31,
"offset": 268,
},
"start": Object {
"start": {
"column": 29,
"line": 31,
"offset": 261,
@@ -267,14 +267,14 @@ Array [
"type": "html",
"value": "</code>",
},
Object {
"position": Object {
"end": Object {
{
"position": {
"end": {
"column": 41,
"line": 31,
"offset": 273,
},
"start": Object {
"start": {
"column": 36,
"line": 31,
"offset": 268,
@@ -283,14 +283,14 @@ Array [
"type": "text",
"value": " and ",
},
Object {
"position": Object {
"end": Object {
{
"position": {
"end": {
"column": 54,
"line": 31,
"offset": 286,
},
"start": Object {
"start": {
"column": 41,
"line": 31,
"offset": 273,
@@ -300,13 +300,13 @@ Array [
"value": "inline code",
},
],
"position": Object {
"end": Object {
"position": {
"end": {
"column": 54,
"line": 31,
"offset": 286,
},
"start": Object {
"start": {
"column": 1,
"line": 31,
"offset": 233,
@@ -314,16 +314,16 @@ Array [
},
"type": "paragraph",
},
Object {
{
"lang": "js",
"meta": null,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 4,
"line": 38,
"offset": 353,
},
"start": Object {
"start": {
"column": 1,
"line": 33,
"offset": 288,
@@ -339,17 +339,17 @@ if(let x of xs) {
`;
exports[`between-headings should match the instructions snapshot 1`] = `
Array [
Object {
"children": Array [
Object {
"position": Object {
"end": Object {
[
{
"children": [
{
"position": {
"end": {
"column": 12,
"line": 11,
"offset": 89,
},
"start": Object {
"start": {
"column": 1,
"line": 11,
"offset": 78,
@@ -359,13 +359,13 @@ Array [
"value": "Paragraph 0",
},
],
"position": Object {
"end": Object {
"position": {
"end": {
"column": 12,
"line": 11,
"offset": 89,
},
"start": Object {
"start": {
"column": 1,
"line": 11,
"offset": 78,
@@ -373,16 +373,16 @@ Array [
},
"type": "paragraph",
},
Object {
{
"lang": "html",
"meta": null,
"position": Object {
"end": Object {
"position": {
"end": {
"column": 4,
"line": 15,
"offset": 117,
},
"start": Object {
"start": {
"column": 1,
"line": 13,
"offset": 91,

View File

@@ -42,7 +42,7 @@
"@storybook/react": "6.5.16",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "12.1.5",
"@types/jest": "27.5.2",
"@types/jest": "29.5.0",
"@types/react": "16.14.35",
"@types/react-dom": "^16.9.17",
"@types/testing-library__jest-dom": "^5",