diff --git a/packages/dev-test/src/env/suite.spec.ts b/packages/dev-test/src/env/suite.spec.ts index 2ffb6e2..c71c443 100644 --- a/packages/dev-test/src/env/suite.spec.ts +++ b/packages/dev-test/src/env/suite.spec.ts @@ -1,12 +1,6 @@ // Copyright 2017-2026 @pezkuwi/dev-test authors & contributors // SPDX-License-Identifier: Apache-2.0 -import '../globals.d.ts'; - -declare const describe: import('./suite.js').Describe; -declare const it: import('./suite.js').It; -declare const expect: (value: unknown) => { toBe: (expected: unknown) => void; toBeDefined: () => void }; - describe('describe()', () => { // eslint-disable-next-line jest/no-focused-tests describe.only('.only', () => { diff --git a/packages/dev/src/rootEsm.spec.ts b/packages/dev/src/rootEsm.spec.ts index 5eeb6b0..ab21951 100644 --- a/packages/dev/src/rootEsm.spec.ts +++ b/packages/dev/src/rootEsm.spec.ts @@ -3,16 +3,16 @@ import type { Describe, It } from '@pezkuwi/dev-test/env/suite.js'; -declare const describe: Describe; -declare const it: It; -declare const expect: (value: unknown) => { toBe: (expected: boolean) => void; toEqual: (expected: unknown) => void }; - import fs from 'node:fs'; import path from 'node:path'; import * as testRoot from './root.js'; import { runTests } from './rootTests.js'; +declare const describe: Describe; +declare const it: It; +declare const expect: (value: unknown) => { toBe: (expected: boolean) => void; toEqual: (expected: unknown) => void }; + runTests(testRoot); describe('as-built output checks', (): void => { @@ -91,8 +91,8 @@ describe('as-built output checks', (): void => { jsIdx[type].includes( type === 'cjs' ? 'require("@pezkuwi/dev/rootJs/testJson.json")' - // eslint-disable-next-line no-useless-escape - : "import testJson from '@pezkuwi/dev/rootJs/testJson.json' assert { type: \'json\' };" + // `with`, not `assert`: Node 22 removed import assertions + : "import testJson from '@pezkuwi/dev/rootJs/testJson.json' with { type: 'json' };" ) ).toBe(true); }) diff --git a/packages/dev/src/rootJs/dynamic.d.mts b/packages/dev/src/rootJs/dynamic.d.mts deleted file mode 100644 index d6c10d8..0000000 --- a/packages/dev/src/rootJs/dynamic.d.mts +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2017-2026 @pezkuwi/dev authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -export function sum(a: number, b: number): number; diff --git a/packages/dev/src/rootJs/index.ts b/packages/dev/src/rootJs/index.ts index 92ecee6..d29386c 100644 --- a/packages/dev/src/rootJs/index.ts +++ b/packages/dev/src/rootJs/index.ts @@ -5,7 +5,7 @@ import './augmented.js'; /** This import should appear as-in in the ouput (cjs without asserts) */ -import testJson from './testJson.json' with { type: 'json' }; +import testJson from '@pezkuwi/dev/rootJs/testJson.json' with { type: 'json' }; /** Double double work, i.e. re-exports */ export { Clazz } from './Clazz.js'; @@ -20,7 +20,7 @@ export function bigIntExp (): bigint { export async function dynamic (a: number, b: number): Promise { // NOTE we go via this path so it points to the same location in both ESM // and CJS output (a './dynamic' import would be different otherwise) - const { sum } = await import('./dynamic.mjs'); + const { sum } = await import('@pezkuwi/dev/rootJs/dynamic.mjs'); // eslint-disable-next-line @typescript-eslint/no-unsafe-return return sum(a, b);