Skip to content

Commit

Permalink
small update
Browse files Browse the repository at this point in the history
  • Loading branch information
dmail committed Jul 23, 2024
1 parent c18408e commit 9e282ac
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { snapshotFunctionSideEffects } from "@jsenv/snapshot";

import { writeImportmaps } from "@jsenv/importmap-node-module";
import { snapshotWriteImportsMapsSideEffects } from "@jsenv/importmap-node-module/tests/snapshot_write_importmaps_side_effects.js";

const test = async (scenario, { bareSpecifierAutomapping }) => {
await snapshotFunctionSideEffects(
await snapshotWriteImportsMapsSideEffects(
() =>
writeImportmaps({
logLevel: "warn",
Expand All @@ -19,9 +18,6 @@ const test = async (scenario, { bareSpecifierAutomapping }) => {
}),
import.meta.url,
`./output/${scenario}/`,
{
filesystemEffects: [`./input/${scenario}.importmap`],
},
);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { writeImportmaps } from "@jsenv/importmap-node-module";
import { snapshotFunctionSideEffects } from "@jsenv/snapshot";
import { snapshotWriteImportsMapsSideEffects } from "@jsenv/importmap-node-module/tests/snapshot_write_importmaps_side_effects.js";

const test = async () => {
await snapshotFunctionSideEffects(
await snapshotWriteImportsMapsSideEffects(
() =>
writeImportmaps({
logLevel: "warn",
Expand All @@ -18,9 +18,6 @@ const test = async () => {
}),
import.meta.url,
`./output/`,
{
filesystemEffects: [`./input/test.importmap`],
},
);
};
await test();
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { writeImportmaps } from "@jsenv/importmap-node-module";
import { snapshotFunctionSideEffects } from "@jsenv/snapshot";
import { snapshotWriteImportsMapsSideEffects } from "@jsenv/importmap-node-module/tests/snapshot_write_importmaps_side_effects.js";

const test = async (scenario, { magicExtensions } = {}) => {
await snapshotFunctionSideEffects(
await snapshotWriteImportsMapsSideEffects(
() =>
writeImportmaps({
logLevel: "warn",
Expand All @@ -18,9 +18,6 @@ const test = async (scenario, { magicExtensions } = {}) => {
}),
import.meta.url,
`./output/${scenario}/`,
{
filesystemEffects: [`./input/test.importmap`],
},
);
};

Expand Down
13 changes: 13 additions & 0 deletions tests/snapshot_write_importmaps_side_effects.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { snapshotFunctionSideEffects } from "@jsenv/snapshot";

export const snapshotWriteImportsMapsSideEffects = async (
fn,
fnFileUrl,
sideEffectDirectoryRelativeUrl,
) => {
await snapshotFunctionSideEffects(
fn,
fnFileUrl,
sideEffectDirectoryRelativeUrl,
);
};

0 comments on commit 9e282ac

Please sign in to comment.