mirror of
https://github.com/pezkuwichain/pezkuwi-dev.git
synced 2026-12-02 18:37:07 +00:00
Undo the test-suite workarounds for the broken manifests
With the manifests broken,b65f265and4539abbworked around the symptoms: rootJs imported itself by relative path instead of as @pezkuwi/dev, a hand-written dynamic.d.mts stood in for the .mjs, and suite.spec.ts declared its own describe/it/expect and imported a .d.ts at run time, which failed the file. All three are reverted to upstream's form. The import-attribute check now expects `with`: Node 22 removed `assert`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
f60cdd90c1
commit
8e81c9041e
4 files changed
+8
-18
No files matched your search
-6
@@ -1,12 +1,6 @@
|
|||||||
// Copyright 2017-2026 @pezkuwi/dev-test authors & contributors
|
// Copyright 2017-2026 @pezkuwi/dev-test authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// 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()', () => {
|
describe('describe()', () => {
|
||||||
// eslint-disable-next-line jest/no-focused-tests
|
// eslint-disable-next-line jest/no-focused-tests
|
||||||
describe.only('.only', () => {
|
describe.only('.only', () => {
|
||||||
|
|||||||
@@ -3,16 +3,16 @@
|
|||||||
|
|
||||||
import type { Describe, It } from '@pezkuwi/dev-test/env/suite.js';
|
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 fs from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
|
|
||||||
import * as testRoot from './root.js';
|
import * as testRoot from './root.js';
|
||||||
import { runTests } from './rootTests.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);
|
runTests(testRoot);
|
||||||
|
|
||||||
describe('as-built output checks', (): void => {
|
describe('as-built output checks', (): void => {
|
||||||
@@ -91,8 +91,8 @@ describe('as-built output checks', (): void => {
|
|||||||
jsIdx[type].includes(
|
jsIdx[type].includes(
|
||||||
type === 'cjs'
|
type === 'cjs'
|
||||||
? 'require("@pezkuwi/dev/rootJs/testJson.json")'
|
? 'require("@pezkuwi/dev/rootJs/testJson.json")'
|
||||||
// eslint-disable-next-line no-useless-escape
|
// `with`, not `assert`: Node 22 removed import assertions
|
||||||
: "import testJson from '@pezkuwi/dev/rootJs/testJson.json' assert { type: \'json\' };"
|
: "import testJson from '@pezkuwi/dev/rootJs/testJson.json' with { type: 'json' };"
|
||||||
)
|
)
|
||||||
).toBe(true);
|
).toBe(true);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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;
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
import './augmented.js';
|
import './augmented.js';
|
||||||
|
|
||||||
/** This import should appear as-in in the ouput (cjs without asserts) */
|
/** 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 */
|
/** Double double work, i.e. re-exports */
|
||||||
export { Clazz } from './Clazz.js';
|
export { Clazz } from './Clazz.js';
|
||||||
@@ -20,7 +20,7 @@ export function bigIntExp (): bigint {
|
|||||||
export async function dynamic (a: number, b: number): Promise<number> {
|
export async function dynamic (a: number, b: number): Promise<number> {
|
||||||
// NOTE we go via this path so it points to the same location in both ESM
|
// 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)
|
// 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
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||||
return sum(a, b);
|
return sum(a, b);
|
||||||
|
|||||||
Reference in new issue
Block a user