-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: improve test coverage by fixing coverage pattern & remove unused
Related to #127
- Loading branch information
Showing
11 changed files
with
47 additions
and
111 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,44 +1,54 @@ | ||
const { resolve } = require( 'path' ); | ||
const { resolve, relative } = require( 'path' ); | ||
|
||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ | ||
const baseConfig = { | ||
/** | ||
* @param package - Package name | ||
* @returns {import('ts-jest/dist/types').InitialOptionsTsJest} - Opts. | ||
*/ | ||
const baseConfig = package => ( { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
globals: { | ||
'ts-jest': { | ||
tsconfig: '<rootDir>/tsconfig.spec.json', | ||
tsconfig: `<rootDir>/packages/${package}/tsconfig.spec.json`, | ||
}, | ||
}, | ||
moduleNameMapper: { | ||
'^#plugintestbed$': resolve( __dirname, './packages/plugintestbed' ), | ||
'^@knodes/typedoc-(plugin.*)$': resolve( __dirname, './packages/$1/src' ), | ||
'^#plugintestbed$': resolve( __dirname, './packages/plugintestbed/src' ), | ||
}, | ||
setupFilesAfterEnv: [ 'jest-extended/all' ], | ||
watchPathIgnorePatterns: [ '<rootDir>/__tests__/mock-fs/' ], | ||
}; | ||
watchPathIgnorePatterns: [ '<rootDir>/.*/__tests__/mock-fs/.*/docs' ], | ||
modulePathIgnorePatterns: [ '<rootDir>/.*/__tests__/mock-fs/.*/' ], | ||
} ); | ||
const anyExt = '.{c,m,}{t,j}s{x,}'; | ||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest[]} */ | ||
module.exports = { | ||
anyExt, | ||
projects: [ | ||
{ | ||
...baseConfig, | ||
displayName: { | ||
name: 'unit', | ||
color: 'blue', | ||
module.exports = projectDir => { | ||
const package = relative( resolve( __dirname, 'packages' ), projectDir ); | ||
const base = baseConfig( package ); | ||
return { | ||
rootDir: resolve( __dirname, 'packages', package ), | ||
projects: [ | ||
{ | ||
...base, | ||
displayName: { | ||
name: 'unit', | ||
color: 'blue', | ||
}, | ||
testMatch: [ `<rootDir>/packages/${package}/src/**/*.spec${anyExt}` ], | ||
}, | ||
testMatch: [ `<rootDir>/src/**/*.spec${anyExt}` ], | ||
}, | ||
{ | ||
...baseConfig, | ||
displayName: { | ||
name: 'integration', | ||
color: 'green', | ||
{ | ||
...base, | ||
displayName: { | ||
name: 'integration', | ||
color: 'green', | ||
}, | ||
testMatch: [ `<rootDir>/packages/${package}/__tests__/integration/**/*.spec${anyExt}` ], | ||
}, | ||
testMatch: [ `<rootDir>/__tests__/integration/**/*.spec${anyExt}` ], | ||
}, | ||
], | ||
collectCoverageFrom: [ | ||
'src/**', | ||
`!**/*.spec${anyExt}`, | ||
], | ||
], | ||
collectCoverageFrom: [ | ||
'packages/*/src/**', | ||
`!**/*.spec${anyExt}`, | ||
], | ||
}; | ||
}; | ||
module.exports.anyExt = anyExt; |
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
15 changes: 0 additions & 15 deletions
15
packages/plugin-code-blocks/src/models/reflections/code-block-reflection.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
packages/plugin-code-blocks/src/models/reflections/reflection-kind.ts
This file was deleted.
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
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
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