Skip to content

Commit a04abcd

Browse files
committed
test(end-to-end): restructure e2e tests
1 parent 33f359b commit a04abcd

File tree

2 files changed

+108
-1
lines changed

2 files changed

+108
-1
lines changed
Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
} from 'testverse:util.ts';
2525

2626
const shortIdentifier = packageName.split('/').at(-1)!;
27-
const TEST_IDENTIFIER = `${shortIdentifier}-e2e`;
27+
const TEST_IDENTIFIER = `${shortIdentifier}-e2e-docs`;
2828
const debug = createDebugLogger({ namespace: shortIdentifier }).extend(TEST_IDENTIFIER);
2929
const nodeVersion = process.env.XPIPE_MATRIX_NODE_VERSION || process.version;
3030

@@ -215,3 +215,38 @@ export async function handler(argv) {
215215
);
216216
});
217217
});
218+
219+
describe('./docs/features.md', () => {
220+
test("it's yargs all the way down", async () => {
221+
expect.hasAssertions();
222+
});
223+
224+
test('run your tool safely and consistently', async () => {
225+
expect.hasAssertions();
226+
});
227+
228+
test('convention over configuration', async () => {
229+
expect.hasAssertions();
230+
});
231+
232+
test('simple comprehensive error handling and reporting', async () => {
233+
expect.hasAssertions();
234+
});
235+
test('a pleasant testing experience', async () => {
236+
expect.hasAssertions();
237+
});
238+
239+
test('built-in debug integration for runtime insights', async () => {
240+
expect.hasAssertions();
241+
});
242+
243+
test('extensive intellisense support', async () => {
244+
expect.hasAssertions();
245+
});
246+
});
247+
248+
describe('./docs/getting-started.md', () => {
249+
test('todo', async () => {
250+
expect.hasAssertions();
251+
});
252+
});
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// * These tests run through the entire process of acquiring this software,
2+
// * using its features as described in the examples documentation, and dealing
3+
// * with its error conditions across a variety of runtimes (e.g. the currently
4+
// * maintained node versions).
5+
// *
6+
// * Typically, these tests involve the use of deep mock fixtures and/or Docker
7+
// * containers, and are built to run in GitHub Actions CI pipelines; some can
8+
// * also be run locally.
9+
10+
import { toAbsolutePath, toDirname, toPath } from '@-xun/fs';
11+
import { readXPackageJsonAtRoot } from '@-xun/project';
12+
import { runnerFactory } from '@-xun/run';
13+
import { createDebugLogger } from 'rejoinder';
14+
15+
import { exports as packageExports, name as packageName } from 'rootverse:package.json';
16+
17+
import {
18+
dummyFilesFixture,
19+
dummyNpmPackageFixture,
20+
ensurePackageHasBeenBuilt,
21+
mockFixturesFactory,
22+
npmCopyPackageFixture,
23+
reconfigureJestGlobalsToSkipTestsInThisFileIfRequested
24+
} from 'testverse:util.ts';
25+
26+
const shortIdentifier = packageName.split('/').at(-1)!;
27+
const TEST_IDENTIFIER = `${shortIdentifier}-e2e-examples`;
28+
const debug = createDebugLogger({ namespace: shortIdentifier }).extend(TEST_IDENTIFIER);
29+
const nodeVersion = process.env.XPIPE_MATRIX_NODE_VERSION || process.version;
30+
31+
debug(`nodeVersion: "${nodeVersion}" (process.version=${process.version})`);
32+
33+
reconfigureJestGlobalsToSkipTestsInThisFileIfRequested({ it: true, test: true });
34+
35+
beforeAll(async () => {
36+
await ensurePackageHasBeenBuilt(
37+
toDirname(toAbsolutePath(require.resolve('rootverse:package.json'))),
38+
packageName,
39+
packageExports
40+
);
41+
});
42+
43+
const packageRoot = toPath(toAbsolutePath(__dirname), '../..');
44+
const withMockedFixture = mockFixturesFactory(
45+
[dummyNpmPackageFixture, dummyFilesFixture, npmCopyPackageFixture],
46+
{
47+
performCleanup: true,
48+
initialVirtualFiles: {
49+
'package.json': JSON.stringify(
50+
{
51+
name: 'dummy-pkg',
52+
version: '0.0.1',
53+
type: 'module'
54+
},
55+
undefined,
56+
2
57+
)
58+
},
59+
packageUnderTest: {
60+
root: packageRoot,
61+
attributes: { cjs: true },
62+
json: readXPackageJsonAtRoot.sync(packageRoot, { useCached: true })
63+
},
64+
identifier: TEST_IDENTIFIER
65+
}
66+
);
67+
68+
describe('./examples', () => {
69+
test('example-todo', async () => {
70+
expect.hasAssertions();
71+
});
72+
});

0 commit comments

Comments
 (0)