Skip to content

Commit

Permalink
removing ts-node from test:standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
Janther committed Mar 17, 2024
1 parent 3db5f9d commit b5a2c3c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Build test app
run: npm run build:test
- name: Run standalone tests
run: npm run test:standalone tests/format tests/integration tests/unit/prettier-version
run: npm run test:standalone

test_linux:
name: Test on Linux with Node ${{ matrix.node }}
Expand Down
12 changes: 7 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const TEST_STANDALONE = Boolean(process.env.TEST_STANDALONE);
const testMatch = [
'<rootDir>/tests/format/**/jsfmt.spec.js',
'<rootDir>/tests/unit/**/*.test.js'
];
const testMatch = ['<rootDir>/tests/format/**/jsfmt.spec.js'];

if (TEST_STANDALONE) {
testMatch.push('<rootDir>/tests/integration/**/*.test.js');
testMatch.push(
'<rootDir>/tests/integration/**/*.test.js',
'<rootDir>/tests/unit/prettier-version/**/*.test.js'
);
} else {
testMatch.push('<rootDir>/tests/unit/**/*.test.js');
}

export default {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"prettier": "prettier './*.{ts,js,cjs,json,md,yml}' '{src,tests}/**/*.{ts,js,cjs}'",
"test": "NODE_OPTIONS=\"--loader=ts-node/esm --loader=esmock\" jest",
"test:all": "cross-env FULL_TEST=1 NODE_OPTIONS=\"--loader=ts-node/esm --loader=esmock\" c8 jest",
"test:standalone": "cross-env NODE_OPTIONS=\"--loader=ts-node/esm\" TEST_STANDALONE=1 FULL_TEST=1 jest"
"test:standalone": "cross-env TEST_STANDALONE=1 FULL_TEST=1 jest"
},
"files": [
"src",
Expand Down
2 changes: 1 addition & 1 deletion tests/config/get-prettier.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function getPrettierInternal() {
const entry = process.env.TEST_STANDALONE
? new URL("./require-standalone.cjs", import.meta.url)
: new URL("./require-prettier.cjs", import.meta.url);
: "prettier";

return import(entry).then((module) => module.default);
}
Expand Down
5 changes: 0 additions & 5 deletions tests/config/require-prettier.cjs

This file was deleted.

0 comments on commit b5a2c3c

Please sign in to comment.