Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare perf of nyc pre-instrumentation vs c8 #1843

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions nyc-run.config.js
@@ -0,0 +1,12 @@
module.exports = {
all: true,
include: ['tests/node_modules/ts-node/**'],
exclude: ['**/*.d.ts', 'tests/node_modules/ts-node/node_modules/**'],
extension: [],
instrument: false,
'hook-require': false,
'hook-run-in-context': false,
'hook-run-in-this-context': false,
excludeNodeModules: false,
excludeAfterRemap: false,
};
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -68,10 +68,12 @@
"build-configSchema": "typescript-json-schema --topRef --refs --validationKeywords allOf --out tsconfig.schema.json tsconfig.build-schema.json TsConfigSchema && node --require ./register ./scripts/create-merged-schema",
"build-pack": "node ./scripts/build-pack.js",
"test-spec": "ava",
"test-cov": "nyc ava",
"test-instrument": "nyc instrument --in-place ./tests/node_modules/ts-node",
"test-cov": "nyc --nycrc-path ./nyc-run.config.js ava",
"test": "npm run build && npm run lint && npm run test-cov --",
"test-local": "npm run lint-fix && npm run build-tsc && npm run build-pack && npm run test-spec --",
"pre-debug": "npm run build-tsc && npm run build-pack",
"coverage-summary": "nyc report",
"coverage-report": "nyc report --reporter=lcov",
"prepare": "npm run clean && npm run build-nopack",
"api-extractor": "api-extractor run --local --verbose",
Expand Down
3 changes: 3 additions & 0 deletions src/test/helpers.ts
Expand Up @@ -122,6 +122,9 @@ export async function installTsNode() {
try {
rimrafSync(join(TEST_DIR, 'node_modules'));
await promisify(childProcessExec)(`npm install`, { cwd: TEST_DIR });
await promisify(childProcessExec)(`npm run test-instrument`, {
cwd: ROOT_DIR,
});
const packageLockPath = join(TEST_DIR, 'package-lock.json');
existsSync(packageLockPath) && unlinkSync(packageLockPath);
break;
Expand Down