diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 69852aa..3e26682 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: run: git diff --exit-code etc/ - name: Run tests - run: pnpm run test + run: pnpm run test:built # Reuses this job's checkout, dependencies, and build. The smoke query # is milliseconds with the binary lookup but catches a linear regression. diff --git a/package.json b/package.json index da092dc..3379543 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,8 @@ "build:dist": "esbuild src/index.ts --bundle --platform=node --format=cjs --outfile=dist/lint-md-parser.cjs --minify && esbuild src/index.ts --bundle --platform=node --format=esm --outfile=dist/lint-md-parser.mjs --minify && esbuild src/mdx.ts --bundle --platform=node --format=cjs --outfile=dist/lint-md-parser-mdx.cjs --minify && esbuild src/mdx.ts --bundle --platform=node --format=esm --outfile=dist/lint-md-parser-mdx.mjs --minify", "build:ts-declaration": "tsc && api-extractor run --local --verbose && api-extractor run --local --verbose --config api-extractor.mdx.json && cp dist/lint-md-parser.d.ts dist/lint-md-parser.d.cts && cp dist/lint-md-parser.d.ts dist/lint-md-parser.d.mts && cp dist/lint-md-parser-mdx.d.ts dist/lint-md-parser-mdx.d.cts && cp dist/lint-md-parser-mdx.d.ts dist/lint-md-parser-mdx.d.mts && for f in dist/lint-md-parser.d.ts dist/lint-md-parser.d.cts dist/lint-md-parser.d.mts dist/lint-md-parser-mdx.d.ts dist/lint-md-parser-mdx.d.cts dist/lint-md-parser-mdx.d.mts; do cat scripts/mdast-augment.d.ts >> \"$f\"; done", "lint": "eslint --ext js,jsx,ts,tsx ./src", - "test": "jest && pnpm run test:types && pnpm run test:package && pnpm run test:mdx3 && pnpm run test:bench-entry", + "test": "pnpm run build && pnpm run test:built", + "test:built": "jest && pnpm run test:types && pnpm run test:package && pnpm run test:mdx3 && pnpm run test:bench-entry", "test:bench-entry": "node scripts/test-bench-markdown-versions.mjs", "test:mdx3": "node scripts/test-mdx3.mjs", "test:types": "tsc -p __tests__/types/tsconfig.json", @@ -69,8 +70,8 @@ "bench:parse": "node scripts/bench-parse.mjs", "preprofile:source-map": "pnpm run build", "profile:source-map": "node --expose-gc scripts/profile-source-map-heap.mjs", - "test:update": "jest --updateSnapshot", - "prepublishOnly": "pnpm run lint && pnpm run build && pnpm run test" + "test:update": "pnpm run build && jest --updateSnapshot", + "prepublishOnly": "pnpm run lint && pnpm run build && pnpm run test:built" }, "devDependencies": { "@attachments/eslint-config": "^0.3.3",