forked from Netcentric/fe-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetClientlib.test.js
More file actions
22 lines (19 loc) · 951 Bytes
/
Copy pathgetClientlib.test.js
File metadata and controls
22 lines (19 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
process.argv.push('--quiet');
const path = require('path');
const defaults = require('../config');
const extendConfig = require('./extendConfig');
const generateEntries = require('./generateEntries');
const getClientlib = require("./getClientlib");
const config = extendConfig('./test/.febuild', defaults);
describe('Test utils/getClientlib.js', () => {
it('Should return from a file location the required info for a clientlib, eg category name, file to import into js.txt etc', () => {
const fileName = 'component.bundle.js';
const folder = 'publish/content/component';
const location = `${folder}${path.sep}${fileName}`;
const clientlibNameCategory = 'publish.content.component'
const clientlib = getClientlib(location, config);
expect(clientlib.name).toBe(clientlibNameCategory);
expect(clientlib.fileName).toBe(fileName);
expect(clientlib.folder).toBe(folder);
});
})