mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-05 21:03:24 -05:00
refactor: migrate challenge parser tests to vitest (#62186)
This commit is contained in:
committed by
GitHub
parent
2590c1c820
commit
28411a2cec
@@ -1,6 +1,6 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`getSection should match the hints snapshot 1`] = `
|
||||
exports[`getSection > should match the hints snapshot 1`] = `
|
||||
[
|
||||
{
|
||||
"children": [
|
||||
@@ -338,7 +338,7 @@ if(let x of xs) {
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`getSection should match the instructions snapshot 1`] = `
|
||||
exports[`getSection > should match the instructions snapshot 1`] = `
|
||||
[
|
||||
{
|
||||
"children": [
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
const isArray = require('lodash/isArray');
|
||||
import isArray from 'lodash/isArray';
|
||||
import { describe, beforeAll, it, expect } from 'vitest';
|
||||
|
||||
const parseFixture = require('../../__fixtures__/parse-fixture');
|
||||
const getAllBefore = require('./before-heading');
|
||||
import parseFixture from '../../__fixtures__/parse-fixture';
|
||||
import getAllBefore from './before-heading';
|
||||
|
||||
describe('before-headings', () => {
|
||||
let simpleAst;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
const { findAll } = require('./find-all');
|
||||
import { describe, it, expect } from 'vitest';
|
||||
|
||||
import { findAll } from './find-all';
|
||||
|
||||
const testTree = {
|
||||
type: 'root',
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
describe('get-file-visitor', () => {
|
||||
it('should join code with newlines', () => {
|
||||
/* i.e. if you've got two js code blocks it should do this
|
||||
|
||||
```js
|
||||
one
|
||||
```
|
||||
|
||||
```js
|
||||
two
|
||||
```
|
||||
|
||||
become
|
||||
|
||||
```js
|
||||
one
|
||||
two
|
||||
```
|
||||
|
||||
not
|
||||
|
||||
```js
|
||||
onetwo
|
||||
```
|
||||
or
|
||||
```js
|
||||
|
||||
one
|
||||
two
|
||||
```
|
||||
*/
|
||||
});
|
||||
});
|
||||
@@ -1,5 +1,7 @@
|
||||
const parseFixture = require('../../__fixtures__/parse-fixture');
|
||||
const getId = require('./get-id');
|
||||
import { describe, beforeAll, it, expect } from 'vitest';
|
||||
|
||||
import parseFixture from '../../__fixtures__/parse-fixture';
|
||||
import getId from './get-id';
|
||||
|
||||
describe('get-id', () => {
|
||||
let idNode, imageNode, multipleChildrenNode;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
const parseFixture = require('../../__fixtures__/parse-fixture');
|
||||
const { getParagraphContent } = require('./get-paragraph-content');
|
||||
import { describe, beforeAll, it, expect } from 'vitest';
|
||||
|
||||
import parseFixture from '../../__fixtures__/parse-fixture';
|
||||
import { getParagraphContent } from './get-paragraph-content';
|
||||
|
||||
describe('getParagraphContent', () => {
|
||||
let simpleAST;
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
const isArray = require('lodash/isArray');
|
||||
const { root } = require('mdast-builder');
|
||||
const find = require('unist-util-find');
|
||||
import { describe, beforeAll, it, expect } from 'vitest';
|
||||
import isArray from 'lodash/isArray';
|
||||
import { root } from 'mdast-builder';
|
||||
import find from 'unist-util-find';
|
||||
|
||||
const parseFixture = require('../../__fixtures__/parse-fixture');
|
||||
const { getSection } = require('./get-section');
|
||||
import parseFixture from '../../__fixtures__/parse-fixture';
|
||||
import { getSection } from './get-section';
|
||||
|
||||
describe('getSection', () => {
|
||||
let simpleAst, extraHeadingAst;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const parseFixture = require('../../__fixtures__/parse-fixture');
|
||||
const mdastToHTML = require('./mdast-to-html');
|
||||
import { describe, beforeAll, it, expect } from 'vitest';
|
||||
import parseFixture from '../../__fixtures__/parse-fixture';
|
||||
import mdastToHTML from './mdast-to-html';
|
||||
|
||||
describe('mdast-to-html', () => {
|
||||
let mdastMixedNodes, singleNode, inlineHTMLNodes;
|
||||
|
||||
Reference in New Issue
Block a user