Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ There are several steps done in a pipeline:
[dnt] Running tests...

> test
> node test_runner.js
> node test_runner.cjs

Running tests in ./script/mod.test.js...

Expand Down
3 changes: 2 additions & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"rules": {
"exclude": [
"no-explicit-any",
"camelcase"
"camelcase",
"no-import-prefix"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This got added to the default ruleset in Deno 2.5. My assumption is this project's okay with inline imports, so I've excluded the rule here.

]
}
},
Expand Down
3 changes: 2 additions & 1 deletion deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/npm_ignore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function runTest(options: {
}

return startText +
`/test_runner.js
`/test_runner.cjs
yarn.lock
pnpm-lock.yaml
`;
Expand Down
2 changes: 1 addition & 1 deletion lib/npm_ignore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function getNpmIgnoreText(options: {
yield `/types/${dtsFilePath}`;
}
}
yield "/test_runner.js";
yield "/test_runner.cjs";
}

function isUsingSourceMaps() {
Expand Down
4 changes: 2 additions & 2 deletions lib/package_json.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Deno.test("single entrypoint", () => {
},
},
scripts: {
test: "node test_runner.js",
test: "node test_runner.cjs",
},
_generatedBy: "dnt@dev",
});
Expand Down Expand Up @@ -499,7 +499,7 @@ Deno.test("peer dependencies", () => {
},
},
scripts: {
test: "node test_runner.js",
test: "node test_runner.cjs",
},
dependencies: {
dep: "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion lib/package_json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function getPackageJson({
};
const scripts = testEnabled
? ({
test: "node test_runner.js",
test: "node test_runner.cjs",
// override with specified scripts
...(packageJsonObj.scripts ?? {}),
})
Expand Down
2 changes: 1 addition & 1 deletion mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ export async function build(options: BuildOptions): Promise<void> {
const denoTestShimPackage = getDependencyByName("@deno/shim-deno-test") ??
getDependencyByName("@deno/shim-deno");
writeFile(
path.join(options.outDir, "test_runner.js"),
path.join(options.outDir, "test_runner.cjs"),
transformCodeToTarget(
getTestRunnerCode({
denoTestShimPackageName: denoTestShimPackage == null
Expand Down
34 changes: 17 additions & 17 deletions tests/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Deno.test("should build test project - basic", async () => {
},
},
scripts: {
test: "node test_runner.js",
test: "node test_runner.cjs",
},
dependencies: {
tslib: versions.tsLib,
Expand Down Expand Up @@ -116,7 +116,7 @@ Deno.test("should build test project - basic", async () => {
/esm/_dnt.test_shims.d.ts
/script/_dnt.test_shims.js
/script/_dnt.test_shims.d.ts
/test_runner.js
/test_runner.cjs
yarn.lock
pnpm-lock.yaml
`,
Expand Down Expand Up @@ -150,7 +150,7 @@ Deno.test("should build test project without esm", async () => {
version: "1.0.0",
main: "./script/mod.js",
scripts: {
test: "node test_runner.js",
test: "node test_runner.cjs",
},
types: "./types/mod.d.ts",
dependencies: {
Expand Down Expand Up @@ -181,7 +181,7 @@ Deno.test("should build test project without esm", async () => {
/types/_dnt.test_polyfills.d.ts
/script/_dnt.test_shims.js
/types/_dnt.test_shims.d.ts
/test_runner.js
/test_runner.cjs
yarn.lock
pnpm-lock.yaml
`,
Expand Down Expand Up @@ -231,7 +231,7 @@ Deno.test("should build with all options off", async () => {
assertEquals(
output.npmIgnore,
`/src/
/test_runner.js
/test_runner.cjs
yarn.lock
pnpm-lock.yaml
`,
Expand Down Expand Up @@ -297,7 +297,7 @@ Deno.test("should build test project with declarations inline by default", async
},
},
scripts: {
test: "node test_runner.js",
test: "node test_runner.cjs",
},
dependencies: {
tslib: versions.tsLib,
Expand Down Expand Up @@ -373,7 +373,7 @@ Deno.test("should build bin project", async () => {
add: "./esm/mod.js",
},
scripts: {
test: "node test_runner.js",
test: "node test_runner.cjs",
},
devDependencies: {
"@types/node": versions.nodeTypes,
Expand Down Expand Up @@ -418,7 +418,7 @@ Deno.test("should build bin project with a shebang", async () => {
hello: "./esm/main.js",
},
scripts: {
test: "node test_runner.js",
test: "node test_runner.cjs",
},
devDependencies: {
picocolors: versions.picocolors,
Expand Down Expand Up @@ -515,7 +515,7 @@ Deno.test("not error for TLA when not using CommonJS", async () => {
},
},
scripts: {
test: "node test_runner.js",
test: "node test_runner.cjs",
},
types: "./types/mod.d.ts",
devDependencies: {
Expand Down Expand Up @@ -590,7 +590,7 @@ Deno.test("should build with source maps", async () => {
/script/_dnt.test_shims.js
/script/_dnt.test_shims.js.map
/script/_dnt.test_shims.d.ts
/test_runner.js
/test_runner.cjs
yarn.lock
pnpm-lock.yaml
`,
Expand Down Expand Up @@ -636,7 +636,7 @@ Deno.test("should build with package mappings", async () => {
},
},
scripts: {
test: "node test_runner.js",
test: "node test_runner.cjs",
},
types: "./types/mod.d.ts",
dependencies: {
Expand All @@ -659,7 +659,7 @@ Deno.test("should build with package mappings", async () => {
/esm/_dnt.test_shims.js
/script/_dnt.test_shims.js
/types/_dnt.test_shims.d.ts
/test_runner.js
/test_runner.cjs
yarn.lock
pnpm-lock.yaml
`,
Expand Down Expand Up @@ -705,7 +705,7 @@ Deno.test("should build with peer dependencies in mappings", async () => {
},
},
scripts: {
test: "node test_runner.js",
test: "node test_runner.cjs",
},
types: "./types/mod.d.ts",
peerDependencies: {
Expand Down Expand Up @@ -1171,7 +1171,7 @@ Deno.test("should build jsr project", async () => {
},
},
scripts: {
test: "node test_runner.js",
test: "node test_runner.cjs",
},
dependencies: {
tslib: versions.tsLib,
Expand All @@ -1195,7 +1195,7 @@ Deno.test("should build jsr project", async () => {
/esm/_dnt.test_shims.d.ts
/script/_dnt.test_shims.js
/script/_dnt.test_shims.d.ts
/test_runner.js
/test_runner.cjs
yarn.lock
pnpm-lock.yaml
`,
Expand Down Expand Up @@ -1241,7 +1241,7 @@ Deno.test("should build workspace project", async () => {
},
},
scripts: {
test: "node test_runner.js",
test: "node test_runner.cjs",
},
dependencies: {
tslib: versions.tsLib,
Expand All @@ -1254,7 +1254,7 @@ Deno.test("should build workspace project", async () => {
assertEquals(
output.npmIgnore,
`/src/
/test_runner.js
/test_runner.cjs
yarn.lock
pnpm-lock.yaml
`,
Expand Down
2 changes: 1 addition & 1 deletion tests/jsr_project/mod.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. MIT license.

import { parse } from "jsr:@std/csv/parse";
import { parse } from "jsr:@std/csv@1.0.6/parse";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linter was complaining about unspecified version. I used the latest @std/csv version specified in deno.lock.

import { assertEquals } from "jsr:@std/assert@0.221/assert-equals";
import * as fs from "node:fs";

Expand Down
Loading