mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
99a1af1c35
* migrate storage package * migrate middleware package * migrate auth-memory plugin
25 lines
792 B
TypeScript
25 lines
792 B
TypeScript
import { describe, expect, test } from 'vitest';
|
|
|
|
import { getManifestValue } from '../src/middlewares/web/utils/manifest';
|
|
|
|
const manifest = require('./partials/manifest/manifest.json');
|
|
|
|
describe('manifest', () => {
|
|
test('getManifestValue', () => {
|
|
expect(getManifestValue(['main.js'], manifest)).toEqual([
|
|
'/-/static/main.6126058572f989c948b1.js',
|
|
]);
|
|
});
|
|
|
|
test('getManifestValue with base', () => {
|
|
expect(getManifestValue(['favicon.ico'], manifest, 'http://domain.com')).toEqual([
|
|
'http://domain.com/-/static/favicon.ico',
|
|
]);
|
|
});
|
|
|
|
test('getManifestValue with base with trailing slash', () => {
|
|
expect(getManifestValue(['favicon.ico'], manifest, 'http://domain.com/')).toEqual([
|
|
'http://domain.com/-/static/favicon.ico',
|
|
]);
|
|
});
|
|
});
|