Skip to content

Commit 0f0d91f

Browse files
Sembaukeojeytonwilliamshuyenltnguyen
authored
chore(tests): migrate shared folder to Vitests (freeCodeCamp#62270)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
1 parent 2eab366 commit 0f0d91f

File tree

11 files changed

+26
-4
lines changed

11 files changed

+26
-4
lines changed

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = {
77
'tools/challenge-parser/',
88
'tools/scripts/build/',
99
'tools/scripts/lint/',
10+
'shared',
1011
'curriculum',
1112
'client',
1213
'shared/'

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@
7070
"serve:client-ci": "cd ./client && pnpm run serve-ci",
7171
"start": "npm-run-all create:shared -p develop:server serve:client",
7272
"test": "NODE_OPTIONS='--max-old-space-size=7168' run-s create:shared build:curriculum build-workers test:**",
73-
"test:source": "jest",
7473
"test:api": "cd api && pnpm test",
7574
"test:tools:challenge-helper-scripts": "cd ./tools/challenge-helper-scripts && pnpm test run",
7675
"test:tools:scripts-build": "cd ./tools/scripts/build && pnpm test run",
7776
"test:tools:scripts-lint": "cd ./tools/scripts/lint && pnpm test run",
7877
"test:tools:challenge-parser": "cd ./tools/challenge-parser && pnpm test run",
7978
"test:curriculum:content": "cd ./curriculum && pnpm test run",
8079
"test:curriculum:tooling": "cd ./curriculum && pnpm vitest run",
81-
"test-curriculum-full-output": "cd ./curriculum && pnpm run test:full-output run",
80+
"test:shared": "cd ./shared && pnpm vitest run",
8281
"test:client": "cd ./client && pnpm test run",
82+
"test-curriculum-full-output": "cd ./curriculum && pnpm run test:full-output run",
8383
"test-config": "jest config",
8484
"test-utils": "jest utils",
8585
"prepare": "husky",

pnpm-lock.yaml

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shared/config/catalog.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, it, expect } from 'vitest';
12
import { catalogSuperBlocks } from './curriculum';
23
import { catalog } from './catalog';
34

shared/config/certification-settings.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, it, expect } from 'vitest';
12
import { Certification, linkedInCredentialIds } from './certification-settings';
23

34
describe('linkedInCredentialIds', () => {

shared/config/constants.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, it, expect } from 'vitest';
12
import { blocklistedUsernames } from './constants';
23

34
describe('constants', () => {

shared/config/curriculum.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, it, expect } from 'vitest';
12
import { Languages } from './i18n';
23
import {
34
SuperBlocks,

shared/package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"node": ">=16",
1010
"pnpm": ">=10"
1111
},
12+
"scripts": {
13+
"test": "vitest"
14+
},
1215
"type": "module",
1316
"repository": {
1417
"type": "git",
@@ -17,5 +20,9 @@
1720
"bugs": {
1821
"url": "https://github.com/freeCodeCamp/freeCodeCamp/issues"
1922
},
20-
"homepage": "https://github.com/freeCodeCamp/freeCodeCamp#readme"
23+
"homepage": "https://github.com/freeCodeCamp/freeCodeCamp#readme",
24+
"devDependencies": {
25+
"vitest": "^3.2.4",
26+
"@vitest/ui": "^3.2.4"
27+
}
2128
}

shared/utils/get-lines.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, it, expect } from 'vitest';
12
import { getLines } from './get-lines';
23

34
const content = 'one\ntwo\nthree';

shared/utils/polyvinyl.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { describe, it, expect } from 'vitest';
12
import { createPoly, createSource } from './polyvinyl';
23

34
const polyData = {

0 commit comments

Comments
 (0)