-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: transpileOnly flag for ts-node
- Loading branch information
Showing
3 changed files
with
28 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,40 @@ | ||
import fs, { existsSync } from 'fs' | ||
import path from 'path' | ||
import process from 'process' | ||
// import fs, { existsSync } from 'fs' | ||
// import path from 'path' | ||
// import process from 'process' | ||
|
||
import { isCI } from 'ci-info' | ||
import * as execa from 'execa' | ||
// import { isCI } from 'ci-info' | ||
// import * as execa from 'execa' | ||
|
||
const { execaCommand } = execa | ||
if (process.argv.includes('-w')) { | ||
execaCommand('tsc -w', { cleanup: true }) | ||
} | ||
// const { execaCommand } = execa | ||
// if (process.argv.includes('-w')) { | ||
// execaCommand('tsc -w', { cleanup: true }) | ||
// } | ||
|
||
// `tests-metadata.json` is created by running `npx lerna run test:measure --scope @netlify/build` | ||
const testData = existsSync('tests-metadata.json') ? JSON.parse(fs.readFileSync('tests-metadata.json', 'utf-8')) : {} | ||
// // `tests-metadata.json` is created by running `npx lerna run test:measure --scope @netlify/build` | ||
// const testData = existsSync('tests-metadata.json') ? JSON.parse(fs.readFileSync('tests-metadata.json', 'utf-8')) : {} | ||
|
||
const getOrder = (file) => { | ||
const fileRelative = path.relative(process.cwd(), file).replace(/\\/g, '/') | ||
if (testData[fileRelative]) { | ||
return testData[fileRelative].order | ||
} | ||
// const getOrder = (file) => { | ||
// const fileRelative = path.relative(process.cwd(), file).replace(/\\/g, '/') | ||
// if (testData[fileRelative]) { | ||
// return testData[fileRelative].order | ||
// } | ||
|
||
console.warn(`Missing test metadata for ${fileRelative}`) | ||
return Number.MAX_SAFE_INTEGER | ||
} | ||
// console.warn(`Missing test metadata for ${fileRelative}`) | ||
// return Number.MAX_SAFE_INTEGER | ||
// } | ||
|
||
const sortTestFiles = (file1, file2) => getOrder(file1) - getOrder(file2) | ||
// const sortTestFiles = (file1, file2) => getOrder(file1) - getOrder(file2) | ||
|
||
const config = { | ||
files: ['packages/**/tests/*.{cjs,mjs,js}', 'packages/**/tests/**/tests.{cjs,mjs,js}'], | ||
verbose: true, | ||
timeout: '240s', | ||
workerThreads: false, | ||
ignoredByWatcher: ['packages/*/tests/*/fixtures/**'], | ||
// workerThreads: false, | ||
environmentVariables: { | ||
FORCE_COLOR: '1', | ||
}, | ||
// we only sort in CI to split efficiently across machines | ||
...(isCI && { sortTestFiles }), | ||
// // we only sort in CI to split efficiently across machines | ||
// ...(isCI && { sortTestFiles }), | ||
} | ||
|
||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters