Skip to content

Commit 851f9f3

Browse files
committed
chore(compartment-mapper): fix compartment map transforms tests
1 parent dec9624 commit 851f9f3

File tree

3 files changed

+28
-23
lines changed

3 files changed

+28
-23
lines changed

packages/compartment-mapper/test/compartment-map-transforms.test.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ import {
2020
import { captureFromMap } from '../capture-lite.js';
2121
import { defaultParserForLanguage } from '../archive-parsers.js';
2222
import { makeReadPowers } from '../src/node-powers.js';
23+
import {
24+
stripCaptureResult,
25+
stripCompartmentMap,
26+
} from './snapshot-utilities.js';
2327

2428
/**
2529
* @import {
@@ -988,7 +992,8 @@ test('Compartment Map Transforms - integration with mapNodeModules()', async t =
988992
},
989993
},
990994
});
991-
t.snapshot(compartmentMap);
995+
996+
t.snapshot(stripCompartmentMap(compartmentMap));
992997
});
993998

994999
test('Compartment Map Transforms - integration with captureFromMap()', async t => {
@@ -1050,5 +1055,5 @@ test('Compartment Map Transforms - integration with captureFromMap()', async t =
10501055
parserForLanguage: defaultParserForLanguage,
10511056
importHook,
10521057
});
1053-
t.snapshot(result);
1058+
t.snapshot(stripCaptureResult(result));
10541059
});

packages/compartment-mapper/test/snapshots/compartment-map-transforms.test.js.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ Generated by [AVA](https://avajs.dev).
3434
sourceDirname: 'webpackish-app',
3535
types: {},
3636
},
37-
'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/webpackish-app/': {
37+
'test/fixtures-dynamic-ancestor/node_modules/webpackish-app/': {
3838
label: '$root$',
39-
location: 'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/webpackish-app/',
39+
location: 'test/fixtures-dynamic-ancestor/node_modules/webpackish-app/',
4040
modules: {
4141
'.': {
42-
compartment: 'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/webpackish-app/',
42+
compartment: 'test/fixtures-dynamic-ancestor/node_modules/webpackish-app/',
4343
createdBy: 'node-modules',
4444
module: './index.js',
4545
},
4646
'webpackish-app': {
47-
compartment: 'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/webpackish-app/',
47+
compartment: 'test/fixtures-dynamic-ancestor/node_modules/webpackish-app/',
4848
createdBy: 'node-modules',
4949
module: './index.js',
5050
},
@@ -77,15 +77,15 @@ Generated by [AVA](https://avajs.dev).
7777
},
7878
scopes: {
7979
'webpackish-app': {
80-
compartment: 'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/webpackish-app/',
80+
compartment: 'test/fixtures-dynamic-ancestor/node_modules/webpackish-app/',
8181
},
8282
},
8383
sourceDirname: 'webpackish-app',
8484
types: {},
8585
},
8686
},
8787
entry: {
88-
compartment: 'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/webpackish-app/',
88+
compartment: 'test/fixtures-dynamic-ancestor/node_modules/webpackish-app/',
8989
module: './build.js',
9090
},
9191
tags: [],
@@ -207,7 +207,7 @@ Generated by [AVA](https://avajs.dev).
207207
},
208208
sha512: undefined,
209209
sourceDirname: 'webpackish-app',
210-
sourceLocation: 'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/webpackish-app/build.js',
210+
sourceLocation: 'test/fixtures-dynamic-ancestor/node_modules/webpackish-app/build.js',
211211
},
212212
},
213213
'jorts-folder': {},
@@ -443,7 +443,7 @@ Generated by [AVA](https://avajs.dev).
443443
},
444444
sha512: undefined,
445445
sourceDirname: 'pantspack',
446-
sourceLocation: 'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/pantspack/pantspack.js',
446+
sourceLocation: 'test/fixtures-dynamic-ancestor/node_modules/pantspack/pantspack.js',
447447
},
448448
},
449449
'pantspack>pantspack-folder-runner': {
@@ -667,30 +667,30 @@ Generated by [AVA](https://avajs.dev).
667667
},
668668
sha512: undefined,
669669
sourceDirname: 'pantspack-folder-runner',
670-
sourceLocation: 'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/pantspack-folder-runner/index.js',
670+
sourceLocation: 'test/fixtures-dynamic-ancestor/node_modules/pantspack-folder-runner/index.js',
671671
},
672672
},
673673
undefined: {},
674674
},
675675
compartmentRenames: {
676-
$root$: 'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/webpackish-app/',
676+
$root$: 'test/fixtures-dynamic-ancestor/node_modules/webpackish-app/',
677677
'<ATTENUATORS>': '<ATTENUATORS>',
678-
'jorts-folder': 'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/jorts-folder/',
679-
pantspack: 'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/pantspack/',
680-
'pantspack>pantspack-folder-runner': 'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/pantspack-folder-runner/',
678+
'jorts-folder': 'test/fixtures-dynamic-ancestor/node_modules/jorts-folder/',
679+
pantspack: 'test/fixtures-dynamic-ancestor/node_modules/pantspack/',
680+
'pantspack>pantspack-folder-runner': 'test/fixtures-dynamic-ancestor/node_modules/pantspack-folder-runner/',
681681
},
682682
newToOldCompartmentNames: {
683-
$root$: 'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/webpackish-app/',
683+
$root$: 'test/fixtures-dynamic-ancestor/node_modules/webpackish-app/',
684684
'<ATTENUATORS>': '<ATTENUATORS>',
685-
'jorts-folder': 'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/jorts-folder/',
686-
pantspack: 'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/pantspack/',
687-
'pantspack>pantspack-folder-runner': 'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/pantspack-folder-runner/',
685+
'jorts-folder': 'test/fixtures-dynamic-ancestor/node_modules/jorts-folder/',
686+
pantspack: 'test/fixtures-dynamic-ancestor/node_modules/pantspack/',
687+
'pantspack>pantspack-folder-runner': 'test/fixtures-dynamic-ancestor/node_modules/pantspack-folder-runner/',
688688
},
689689
oldToNewCompartmentNames: {
690690
'<ATTENUATORS>': '<ATTENUATORS>',
691-
'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/jorts-folder/': 'jorts-folder',
692-
'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/pantspack-folder-runner/': 'pantspack>pantspack-folder-runner',
693-
'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/pantspack/': 'pantspack',
694-
'file:///Users/boneskull/projects/endojs/endo/packages/compartment-mapper/test/fixtures-dynamic-ancestor/node_modules/webpackish-app/': '$root$',
691+
'test/fixtures-dynamic-ancestor/node_modules/jorts-folder/': 'jorts-folder',
692+
'test/fixtures-dynamic-ancestor/node_modules/pantspack-folder-runner/': 'pantspack>pantspack-folder-runner',
693+
'test/fixtures-dynamic-ancestor/node_modules/pantspack/': 'pantspack',
694+
'test/fixtures-dynamic-ancestor/node_modules/webpackish-app/': '$root$',
695695
},
696696
}
Binary file not shown.

0 commit comments

Comments
 (0)