MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / fixture

Function fixture

libatomic/scripts/package-runtime.test.mjs:10–26  ·  view source on GitHub ↗
(t, target = 'aarch64-apple-darwin')

Source from the content-addressed store, hash-verified

8
9const revision = 'a'.repeat(40);
10function fixture(t, target = 'aarch64-apple-darwin') {
11 const dir = mkdtempSync(join(tmpdir(), 'libatomic-runtime-'));
12 t.after(() => rmSync(dir, { recursive: true, force: true }));
13 const spec = targets[target];
14 writeFileSync(join(dir, spec.source), 'native fixture');
15 return {
16 options: { target, buildDir: dir, outputDir: join(dir, 'runtime'), version: '0.19.1', revision },
17 dependencies: {
18 host: { platform: spec.platform, arch: spec.arch, versions: { napi: '8' } },
19 load: (path) => {
20 assert.equal(basename(path), spec.library);
21 assert.equal(readFileSync(path, 'utf8'), 'native fixture');
22 return { call() {}, descriptor: () => Buffer.from('descriptor fixture') };
23 },
24 },
25 };
26}
27
28for (const [target, spec] of Object.entries(targets)) {
29 test(`normalizes ${target} and records release identity and checksums`, (t) => {

Callers 1

Calls 3

afterMethod · 0.80
equalMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected