MCPcopy
hub / github.com/compodoc/compodoc / checkWcMenuFile

Function checkWcMenuFile

test/src/cli/cli-i18n.spec.ts:9–39  ·  view source on GitHub ↗
(lang, message)

Source from the content-addressed store, hash-verified

7 const distFolder = tmp.name + '-i18n';
8
9 const checkWcMenuFile = (lang, message) => {
10 before(function (done) {
11 tmp.create(distFolder);
12 let ls = shell('node', [
13 './bin/index-cli.js',
14 '-p',
15 './test/fixtures/sample-files/tsconfig.simple.json',
16 '--language',
17 lang,
18 '-d',
19 distFolder
20 ]);
21
22 if (ls.stderr.toString() !== '') {
23 console.error(`shell error: ${ls.stderr.toString()}`);
24 done('error');
25 }
26 done();
27 });
28 after(() => tmp.clean(distFolder));
29
30 it('it should contain a sentence in the correct language', () => {
31 let file = read(distFolder + '/js/menu-wc.js');
32 try {
33 const script = new vm.Script(file);
34 } catch (e) {
35 throw new Error('Error parsing menu-wc.js file');
36 }
37 expect(file).to.contain(message);
38 });
39 };
40
41 describe('with supported language - en-US', () => {
42 return checkWcMenuFile('en-US', 'Documentation generated using');

Callers 1

cli-i18n.spec.tsFile · 0.85

Calls 6

readFunction · 0.90
doneFunction · 0.85
cleanMethod · 0.80
itFunction · 0.50
createMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…