@netlify/edge-bundler 5.3.1 → 5.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,6 +8,7 @@ import { useFixture } from '../test/util.js';
|
|
|
8
8
|
import { BundleError } from './bundle_error.js';
|
|
9
9
|
import { bundle } from './bundler.js';
|
|
10
10
|
import { isNodeError } from './utils/error.js';
|
|
11
|
+
import { validateManifest } from './validation/manifest/index.js';
|
|
11
12
|
test('Produces an ESZIP bundle', async () => {
|
|
12
13
|
const { basePath, cleanup, distPath } = await useFixture('with_import_maps');
|
|
13
14
|
const declarations = [
|
|
@@ -27,6 +28,7 @@ test('Produces an ESZIP bundle', async () => {
|
|
|
27
28
|
expect(generatedFiles.length).toBe(3);
|
|
28
29
|
const manifestFile = await fs.readFile(resolve(distPath, 'manifest.json'), 'utf8');
|
|
29
30
|
const manifest = JSON.parse(manifestFile);
|
|
31
|
+
expect(() => validateManifest(manifest)).not.toThrowError();
|
|
30
32
|
const { bundles, import_map: importMapURL } = manifest;
|
|
31
33
|
expect(bundles.length).toBe(1);
|
|
32
34
|
expect(bundles[0].format).toBe('eszip2');
|
|
@@ -115,12 +115,12 @@ describe('layers', () => {
|
|
|
115
115
|
describe('import map URL', () => {
|
|
116
116
|
test('should accept string value', () => {
|
|
117
117
|
const manifest = getBaseManifest();
|
|
118
|
-
manifest.
|
|
118
|
+
manifest.import_map = 'file:///root/.netlify/edge-functions-dist/import_map.json';
|
|
119
119
|
expect(() => validateManifest(manifest)).not.toThrowError();
|
|
120
120
|
});
|
|
121
121
|
test('should throw on wrong type', () => {
|
|
122
122
|
const manifest = getBaseManifest();
|
|
123
|
-
manifest.
|
|
123
|
+
manifest.import_map = ['file:///root/.netlify/edge-functions-dist/import_map.json'];
|
|
124
124
|
expect(() => validateManifest(manifest)).toThrowErrorMatchingSnapshot();
|
|
125
125
|
});
|
|
126
126
|
});
|