Skip to content

Commit

Permalink
fix: node-test tsconfig (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimonka83 committed Sep 11, 2023
1 parent 96285c9 commit 258fd72
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/node-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@packasso/core": "workspace:*",
"c8": "8.0.1",
"fast-glob": "3.3.1",
"find-up": "6.3.0",
"istanbul-merge": "2.0.0",
"nyc": "15.1.0",
"tsx": "3.12.8"
Expand Down
21 changes: 21 additions & 0 deletions packages/node-test/src/main/ts/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,35 @@ import {
cmd,
createCommand,
createCommandClean,
createCommandInstall,
createCommandPurge,
execute,
getTopo,
Install,
program,
testCoverageDir,
testCoverageMergeAndReport,
testSuffixes,
TestType,
} from '@packasso/core'
import fg from 'fast-glob'
import { findUpSync } from 'find-up'

const tsConfigTest = 'tsconfig.node-test.json'

const install: Install = {
data: (pkg) => [
pkg.tree
? {
[tsConfigTest]: {
compilerOptions: {
experimentalDecorators: true,
},
},
}
: {},
],
}

const createCommandTest = (
name: string,
Expand Down Expand Up @@ -40,6 +59,7 @@ const createCommandTest = (
_:
files.length > 0
? cmd('tsx', {
tsconfig: findUpSync(tsConfigTest, { cwd }),
test: true,
_: files,
})
Expand All @@ -52,6 +72,7 @@ const createCommandTest = (
})

program(
createCommandInstall(install),
createCommandClean([`${testCoverageDir}-*`, testCoverageDir]),
createCommandPurge(['coverage', 'tsconfig.test.json']),
createCommandTest('test', 'all tests', ['unit', 'it', 'e2e']),
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3205,6 +3205,7 @@ __metadata:
"@packasso/core": "workspace:*"
c8: 8.0.1
fast-glob: 3.3.1
find-up: 6.3.0
istanbul-merge: 2.0.0
nyc: 15.1.0
tsx: 3.12.8
Expand Down

0 comments on commit 258fd72

Please sign in to comment.