mirror of
https://github.com/pezkuwichain/pezkuwi-dev.git
synced 2026-04-22 04:27:58 +00:00
b65f265e87
- Add explicit Describe and It interfaces with todo support - Fix mock type compatibility in jest.ts - Update import assertions to import attributes (assert -> with) - Add dynamic.d.mts declaration file - Fix spec files to use explicit type declarations
68 lines
1.7 KiB
TypeScript
68 lines
1.7 KiB
TypeScript
// 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', () => {
|
|
it('runs this one', () => {
|
|
expect(true).toBe(true);
|
|
});
|
|
});
|
|
|
|
describe('.skip', () => {
|
|
// eslint-disable-next-line jest/no-disabled-tests
|
|
describe.skip('.only (.skip)', () => {
|
|
it('skips inside .only', () => {
|
|
expect(true).toBe(true);
|
|
|
|
throw new Error('FATAL: This should not run');
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
describe('it()', () => {
|
|
it('has been enhanced', () => {
|
|
expect(it.todo).toBeDefined();
|
|
});
|
|
|
|
it('allows promises', async () => {
|
|
expect(await Promise.resolve(true)).toBe(true);
|
|
});
|
|
|
|
describe('.only', () => {
|
|
// eslint-disable-next-line jest/no-focused-tests
|
|
it.only('runs this test when .only is used', () => {
|
|
expect(true).toBe(true);
|
|
});
|
|
|
|
// eslint-disable-next-line jest/no-disabled-tests
|
|
it.skip('skips when .skip is used', () => {
|
|
expect(true).toBe(true);
|
|
|
|
throw new Error('FATAL: This should not run');
|
|
});
|
|
});
|
|
|
|
describe('.skip', () => {
|
|
// eslint-disable-next-line jest/no-disabled-tests
|
|
it.skip('skips when .skip is used', () => {
|
|
expect(true).toBe(true);
|
|
|
|
throw new Error('FATAL: This should not run');
|
|
});
|
|
});
|
|
|
|
describe('.todo', () => {
|
|
it.todo('marks as a todo when .todo is used', () => {
|
|
expect(true).toBe(true);
|
|
});
|
|
});
|
|
});
|