Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from Jest to Vitest #45

Merged
merged 2 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35,178 changes: 12,561 additions & 22,617 deletions package-lock.json

Large diffs are not rendered by default.

58 changes: 19 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,62 +8,42 @@
"build": "npm run build -ws",
"package": "npm run package -ws",
"publish": "npm run publish -ws",
"test": "jest ./packages",
"test:ci": "jest ./packages --maxWorkers=1"
},
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!unified|bail|is-plain-obj|trough|vfile.*|unist.*|hast.*|property-information|html-void-elements|.*-separated-tokens|.*entities.*|ccount|rehype*|string-width|strip-ansi|ansi-regex|supports-color|rehype|web-namespaces|zwitch)"
],
"transform": {
"\\.m?jsx?$": "esbuild-jest",
"latex.pegjs$": "<rootDir>/tests/pegjs-preprocessor-latex.js",
"\\.pegjs$": "<rootDir>/tests/pegjs-preprocessor.js",
"^.+\\.tsx?$": "ts-jest"
},
"haste": {
"forceNodeFilesystemAPI": true
},
"modulePathIgnorePatterns": [
"/dist/"
]
"test": "vitest ./packages",
"test:ci": "vitest ./packages --maxWorkers=1"
},
"devDependencies": {
"@types/jest": "^29.4.0",
"@types/node": "^18.11.19",
"esbuild": "^0.17.5",
"esbuild-jest": "^0.5.0",
"@types/node": "^20.5.9",
"@types/prettier": "^2.7.3",
"esbuild": "^0.19.2",
"esbuild-runner": "^2.2.2",
"jest": "^29.4.1",
"lerna": "^6.4.1",
"lerna": "^7.2.0",
"lerna-update-wizard": "^1.1.2",
"mdast-builder": "^1.1.1",
"mdast-util-inject": "^1.1.0",
"mkdirp": "^2.1.3",
"pegjs": "^0.10.0",
"prettier": "^2.8.3",
"prettier-plugin-pegjs": "^0.5.3",
"mkdirp": "^3.0.1",
"prettier": "^2.8.8",
"prettier-plugin-pegjs": "^0.5.4",
"remark-gfm": "^3.0.1",
"remark-parse": "^10.0.1",
"remark-stringify": "^10.0.2",
"ts-jest": "^29.0.5",
"ts-morph": "^17.0.1",
"typescript": "^4.9.5"
"remark-parse": "^10.0.2",
"remark-stringify": "^10.0.3",
"ts-morph": "^19.0.0",
"typescript": "^5.2.2",
"vitest": "^0.34.3"
},
"dependencies": {
"@types/color": "^3.0.3",
"@types/color": "^3.0.4",
"@types/cssesc": "^3.0.0",
"@types/text-table": "^0.2.2",
"camelcase": "^7.0.1",
"chalk": "^5.2.0",
"camelcase": "^8.0.0",
"chalk": "^5.3.0",
"chokidar": "^3.5.3",
"color": "^4.2.3",
"cssesc": "^3.0.0",
"fault": "^2.0.1",
"hastscript": "^7.2.0",
"json5": "^2.2.3",
"minimist": "^1.2.7",
"peggy": "^2.0.1",
"minimist": "^1.2.8",
"peggy": "^3.0.2",
"rehype-format": "^4.0.1",
"text-table": "^0.2.0",
"unified": "^10.1.2",
Expand Down
15 changes: 2 additions & 13 deletions packages/structured-clone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"build": "npm run clean && mkdirp ./dist && npm run compile",
"clean": "rm -rf ./dist && rm -rf tsconfig.tsbuildinfo",
"compile": "tsc -b tsconfig.json & node build.js & wait",
"test": "jest"
"test": "vitest"
},
"repository": {
"type": "git",
Expand All @@ -44,16 +44,5 @@
"bugs": {
"url": "https://github.com/siefkenj/unified-latex/issues"
},
"homepage": "https://github.com/siefkenj/unified-latex#readme",
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!unified|bail|is-plain-obj|trough|vfile.*|unist.*|hast.*|property-information|html-void-elements|.*-separated-tokens|.*entities.*|ccount|rehype*|string-width|strip-ansi|ansi-regex|supports-color)"
],
"transform": {
"\\.m?jsx?$": "esbuild-jest",
"latex.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor-latex.js",
"\\.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor.js",
"^.+\\.tsx?$": "ts-jest"
}
}
"homepage": "https://github.com/siefkenj/unified-latex#readme"
}
11 changes: 0 additions & 11 deletions packages/support-tables/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,5 @@
"url": "https://github.com/siefkenj/unified-latex/issues"
},
"homepage": "https://github.com/siefkenj/unified-latex#readme",
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!unified|bail|is-plain-obj|trough|vfile.*|unist.*|hast.*|property-information|html-void-elements|.*-separated-tokens|.*entities.*|ccount|rehype*|string-width|strip-ansi|ansi-regex|supports-color)"
],
"transform": {
"\\.m?jsx?$": "esbuild-jest",
"latex.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor-latex.js",
"\\.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor.js",
"^.+\\.tsx?$": "ts-jest"
}
},
"private": true
}
14 changes: 0 additions & 14 deletions packages/unified-latex-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,5 @@
"url": "https://github.com/siefkenj/unified-latex/issues"
},
"homepage": "https://github.com/siefkenj/unified-latex#readme",
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!unified|bail|is-plain-obj|trough|vfile.*|unist.*|hast.*|property-information|html-void-elements|.*-separated-tokens|.*entities.*|ccount|rehype*|string-width|strip-ansi|ansi-regex|supports-color)"
],
"transform": {
"\\.m?jsx?$": "ts-jest",
"latex.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor-latex.js",
"\\.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor.js",
"^.+\\.tsx?$": "ts-jest"
},
"modulePathIgnorePatterns": [
"/dist/"
]
},
"private": true
}
19 changes: 2 additions & 17 deletions packages/unified-latex-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"hastscript": "^7.2.0",
"json5": "^2.2.3",
"minimist": "^1.2.7",
"prettier": "^2.8.3",
"rehype-stringify": "^9.0.3",
"prettier": "^2.8.8",
"rehype-stringify": "^9.0.4",
"text-table": "^0.2.0",
"unified": "^10.1.2",
"unified-engine": "^10.1.0"
Expand All @@ -51,7 +51,6 @@
"build": "npm run clean && mkdirp ./dist && npm run compile",
"clean": "rm -rf ./dist && rm -rf tsconfig.tsbuildinfo",
"compile": "tsc -b tsconfig.json & node build.js & wait",
"test": "jest",
"package": "node ../../scripts/make-package.mjs",
"publish": "cd dist && npm publish"
},
Expand All @@ -73,19 +72,5 @@
"url": "https://github.com/siefkenj/unified-latex/issues"
},
"homepage": "https://github.com/siefkenj/unified-latex#readme",
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!unified|bail|is-plain-obj|trough|vfile.*|unist.*|hast.*|property-information|html-void-elements|.*-separated-tokens|.*entities.*|ccount|rehype*|string-width|strip-ansi|ansi-regex|supports-color)"
],
"transform": {
"\\.m?jsx?$": "esbuild-jest",
"latex.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor-latex.js",
"\\.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor.js",
"^.+\\.tsx?$": "ts-jest"
},
"modulePathIgnorePatterns": [
"/dist/"
]
},
"private": true
}
62 changes: 31 additions & 31 deletions packages/unified-latex-cli/tests/__snapshots__/cli.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`unified-latex-cli can expand macro 1`] = `
"% Expand via> tests/needs-expanding.tex --stats -e "\\\\newcommand{foo}[1]{FOO(#1)}" -e '{name: "bar", body: "baz"}'
exports[`unified-latex-cli > can expand macro 1`] = `
"% Expand via> tests/needs-expanding.tex --stats -e \\"\\\\\\\\newcommand{foo}[1]{FOO(#1)}\\" -e '{name: \\"bar\\", body: \\"baz\\"}'
hi FOO(fooArg) and baz!
"
`;

exports[`unified-latex-cli can expand macro 2`] = `
"% Expand via> tests/needs-expanding.tex --stats -e "\\\\newcommand{foo}[1]{FOO(#1)}" -e '{name: "bar", body: "baz"}'
hi $\\x fooArg$ and baz!
exports[`unified-latex-cli > can expand macro 2`] = `
"% Expand via> tests/needs-expanding.tex --stats -e \\"\\\\\\\\newcommand{foo}[1]{FOO(#1)}\\" -e '{name: \\"bar\\", body: \\"baz\\"}'
hi $\\\\x fooArg$ and baz!
"
`;

exports[`unified-latex-cli can expand macros defined in document 1`] = `
"\\newcommand{\\foo}[1]{$BAR #1$}
\\DeclareDocumentCommand{\\baz}{m}{\\foo{xxx} .#1.}
We $BAR ME$ and \\foo{xxx} .YOU.
exports[`unified-latex-cli > can expand macros defined in document 1`] = `
"\\\\newcommand{\\\\foo}[1]{$BAR #1$}
\\\\DeclareDocumentCommand{\\\\baz}{m}{\\\\foo{xxx} .#1.}
We $BAR ME$ and \\\\foo{xxx} .YOU.
"
`;

exports[`unified-latex-cli can format document 1`] = `
"\\section*{Really Cool Math}
Below you'll$x$ $x$ find some {\\bf really} cool {\\em math} {\\em foo}.
exports[`unified-latex-cli > can format document 1`] = `
"\\\\section*{Really Cool Math}
Below you'll$x$ $x$ find some {\\\\bf really} cool {\\\\em math} {\\\\em foo}.

\\def\\foo{FOO}
\\\\def\\\\foo{FOO}

Check it out!
\\begin{enumerate}
\\item[(a)] Hi there $sin(x)$

\\item $e^{2}$ is math mode!
\\[
\\begin{bmatrix}
12 & 3^{e} \\\\
\\pi & 0
\\end{bmatrix}
\\]
\\end{enumerate}
\\\\begin{enumerate}
\\\\item[(a)] Hi there $sin(x)$

\\\\item $e^{2}$ is math mode!
\\\\[
\\\\begin{bmatrix}
12 & 3^{e} \\\\\\\\
\\\\pi & 0
\\\\end{bmatrix}
\\\\]
\\\\end{enumerate}
"
`;

exports[`unified-latex-cli can override default macros 1`] = `
"$\\mathbb{X} Y$
exports[`unified-latex-cli > can override default macros 1`] = `
"$\\\\mathbb{X} Y$
"
`;

exports[`unified-latex-cli can override default macros 2`] = `
"$\\mathbb X Y$
exports[`unified-latex-cli > can override default macros 2`] = `
"$\\\\mathbb X Y$
"
`;

exports[`unified-latex-cli can override default macros 3`] = `
"$\\mathbb{X}{Y}$
exports[`unified-latex-cli > can override default macros 3`] = `
"$\\\\mathbb{X}{Y}$
"
`;
16 changes: 1 addition & 15 deletions packages/unified-latex-ctan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"build": "npm run clean && mkdirp ./dist && npm run compile",
"clean": "rm -rf ./dist && rm -rf tsconfig.tsbuildinfo",
"compile": "tsc -b tsconfig.json & node build.js & wait",
"test": "jest",
"test": "vitest",
"package": "node ../../scripts/make-package.mjs",
"publish": "cd dist && npm publish"
},
Expand All @@ -75,19 +75,5 @@
"url": "https://github.com/siefkenj/unified-latex/issues"
},
"homepage": "https://github.com/siefkenj/unified-latex#readme",
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!unified|bail|is-plain-obj|trough|vfile.*|unist.*|hast.*|property-information|html-void-elements|.*-separated-tokens|.*entities.*|ccount|rehype*|string-width|strip-ansi|ansi-regex|supports-color|rehype|web-namespaces|zwitch)"
],
"transform": {
"\\.m?jsx?$": "esbuild-jest",
"latex.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor-latex.js",
"\\.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor.js",
"^.+\\.tsx?$": "ts-jest"
},
"modulePathIgnorePatterns": [
"/dist/"
]
},
"private": true
}
18 changes: 2 additions & 16 deletions packages/unified-latex-lint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@unified-latex/unified-latex-util-scan": "^1.4.0",
"@unified-latex/unified-latex-util-trim": "^1.4.0",
"@unified-latex/unified-latex-util-visit": "^1.4.0",
"unified-lint-rule": "^2.1.1",
"unist-util-position": "^4.0.3"
"unified-lint-rule": "^2.1.2",
"unist-util-position": "^4.0.4"
},
"files": [
"dist/**/*.ts",
Expand Down Expand Up @@ -72,19 +72,5 @@
"url": "https://github.com/siefkenj/unified-latex/issues"
},
"homepage": "https://github.com/siefkenj/unified-latex#readme",
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!unified|bail|is-plain-obj|trough|vfile.*|unist.*|hast.*|property-information|html-void-elements|.*-separated-tokens|.*entities.*|ccount|rehype*|string-width|strip-ansi|ansi-regex|supports-color)"
],
"transform": {
"\\.m?jsx?$": "esbuild-jest",
"latex.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor-latex.js",
"\\.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor.js",
"^.+\\.tsx?$": "ts-jest"
},
"modulePathIgnorePatterns": [
"/dist/"
]
},
"private": true
}
16 changes: 1 addition & 15 deletions packages/unified-latex-prettier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"build": "npm run clean && mkdirp ./dist && npm run compile",
"clean": "rm -rf ./dist && rm -rf tsconfig.tsbuildinfo",
"compile": "tsc -b tsconfig.json & node build.js & wait",
"test": "jest",
"test": "vitest",
"package": "node ../../scripts/make-package.mjs",
"publish": "cd dist && npm publish"
},
Expand All @@ -60,19 +60,5 @@
"url": "https://github.com/siefkenj/unified-latex/issues"
},
"homepage": "https://github.com/siefkenj/unified-latex#readme",
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!unified|bail|is-plain-obj|trough|vfile.*|unist.*|hast.*|property-information|html-void-elements|.*-separated-tokens|.*entities.*|ccount|rehype*|string-width|strip-ansi|ansi-regex|supports-color)"
],
"transform": {
"\\.m?jsx?$": "esbuild-jest",
"latex.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor-latex.js",
"\\.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor.js",
"^.+\\.tsx?$": "ts-jest"
},
"modulePathIgnorePatterns": [
"/dist/"
]
},
"private": true
}
20 changes: 3 additions & 17 deletions packages/unified-latex-to-hast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
"@unified-latex/unified-latex-util-visit": "^1.4.0",
"cssesc": "^3.0.0",
"hast": "^1.0.0",
"hast-util-to-html": "^8.0.3",
"hastscript": "^7.0.2",
"hast-util-to-html": "^8.0.4",
"hastscript": "^7.2.0",
"prettier": "^2.8.8",
"rehype-raw": "^6.1.1",
"rehype-stringify": "^9.0.3",
"rehype-stringify": "^9.0.4",
"unified": "^10.1.2"
},
"files": [
Expand Down Expand Up @@ -71,19 +71,5 @@
"url": "https://github.com/siefkenj/unified-latex/issues"
},
"homepage": "https://github.com/siefkenj/unified-latex#readme",
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!unified|bail|is-plain-obj|trough|vfile.*|unist.*|hast.*|property-information|html-void-elements|.*-separated-tokens|.*entities.*|ccount|rehype*|string-width|strip-ansi|ansi-regex|supports-color|rehype|web-namespaces|zwitch)"
],
"transform": {
"\\.m?jsx?$": "esbuild-jest",
"latex.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor-latex.js",
"\\.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor.js",
"^.+\\.tsx?$": "ts-jest"
},
"modulePathIgnorePatterns": [
"/dist/"
]
},
"private": true
}
Loading