-
-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
feac92b
commit fd21485
Showing
16 changed files
with
346 additions
and
8 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
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,5 +1,5 @@ | ||
# Outputs | ||
/dist | ||
dist | ||
|
||
# Logs | ||
*.log | ||
|
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,11 +1,30 @@ | ||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const config = { | ||
// Need to extend from a base config because projects don't inherit configurations as documented | ||
// https://github.com/jestjs/jest/issues/11411 | ||
/** @type {import('@jest/types').Config.InitialProjectOptions} */ | ||
const baseConfig = { | ||
transform: { | ||
'^.+\\.(t|j)sx?$': ['@swc/jest'], | ||
'.*': ['@swc/jest'], | ||
}, | ||
collectCoverage: true, | ||
collectCoverageFrom: ['src/**/*.ts', '!src/index.ts'], | ||
testPathIgnorePatterns: ['/node_modules/', '/dist'], | ||
}; | ||
|
||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
const config = { | ||
collectCoverage: true, | ||
projects: [ | ||
{ | ||
...baseConfig, | ||
displayName: 'unit', | ||
collectCoverageFrom: ['src/**/*.ts', '!src/index.ts'], | ||
// (src|bin) doesn't seem to work on Windows | ||
testMatch: ['src', 'bin'].map((dir) => `<rootDir>/${dir}/**/*.spec.ts`), | ||
}, | ||
{ | ||
...baseConfig, | ||
displayName: 'smoke', | ||
testMatch: ['<rootDir>/tests/**/*.spec.ts'], | ||
}, | ||
], | ||
}; | ||
|
||
module.exports = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"type": "commonjs" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import type { ConcurrentlyResult } from 'concurrently'; | ||
import concurrently, { concurrently as concurrently2, createConcurrently } from 'concurrently'; | ||
|
||
const result: ConcurrentlyResult = concurrently(['ls'], { | ||
raw: true, | ||
}); | ||
|
||
const result2: ConcurrentlyResult = concurrently2(['ls'], { | ||
killOthers: ['failure'], | ||
}); | ||
|
||
const result3: ConcurrentlyResult = createConcurrently(['ls'], { | ||
successCondition: 'all', | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
"module": "CommonJS", | ||
"moduleResolution": "Node", | ||
"skipLibCheck": true | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"type": "commonjs" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
|
||
import concurrently = require('concurrently'); | ||
|
||
const { concurrently: concurrently2, createConcurrently } = concurrently; | ||
|
||
const result: concurrently.ConcurrentlyResult = concurrently(['ls'], { | ||
raw: true, | ||
}); | ||
|
||
const result2: concurrently.ConcurrentlyResult = concurrently2(['ls'], { | ||
killOthers: ['failure'], | ||
}); | ||
|
||
const result3: concurrently.ConcurrentlyResult = createConcurrently(['ls'], { | ||
successCondition: 'all', | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
"module": "CommonJS", | ||
"moduleResolution": "Node", | ||
"skipLibCheck": true | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"type": "module" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import type { ConcurrentlyResult } from 'concurrently'; | ||
import concurrently, { concurrently as concurrently2, createConcurrently } from 'concurrently'; | ||
|
||
const result: ConcurrentlyResult = concurrently(['ls'], { | ||
raw: true, | ||
}); | ||
|
||
const result2: ConcurrentlyResult = concurrently2(['ls'], { | ||
killOthers: ['failure'], | ||
}); | ||
|
||
const result3: ConcurrentlyResult = createConcurrently(['ls'], { | ||
successCondition: 'all', | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
"module": "Node16", | ||
"moduleResolution": "Node16" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"dependencies": { | ||
"concurrently": "file:.." | ||
}, | ||
"scripts": { | ||
"test": "pnpm --prefix .. test -- --selectProjects smoke" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { exec as originalExec } from 'child_process'; | ||
import * as util from 'util'; | ||
|
||
const exec = util.promisify(originalExec); | ||
|
||
beforeAll(async () => { | ||
await exec('pnpm build', { cwd: `${__dirname}/..` }); | ||
await exec('pnpm install', { cwd: __dirname }); | ||
}, 10000); | ||
|
||
it.each(['cjs-import', 'cjs-require', 'esm'])( | ||
'%s', | ||
async (project) => { | ||
// Use as separate execs as tsc outputs to stdout, instead of stderr, and so its text isn't shown | ||
await exec(`tsc -p ${project}`, { cwd: __dirname }).catch((err) => | ||
Promise.reject(err.stdout), | ||
); | ||
await exec(`node ${project}/dist/smoke-test.js`, { cwd: __dirname }); | ||
}, | ||
10000, | ||
); |