MCPcopy
hub / github.com/pugjs/pug / testDirError

Function testDirError

packages/pug-linker/test/index.test.js:15–34  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

13}
14
15function testDirError(dir) {
16 fs.readdirSync(dir).forEach(function(name) {
17 if (!/\.input\.json$/.test(name)) return;
18 test(name, function() {
19 var input = JSON.parse(fs.readFileSync(dir + '/' + name, 'utf8'));
20 var err;
21 try {
22 link(input);
23 } catch (ex) {
24 err = {
25 msg: ex.msg,
26 code: ex.code,
27 line: ex.line,
28 };
29 }
30 if (!err) throw new Error('Expected error');
31 expect(err).toMatchSnapshot();
32 });
33 });
34}
35
36describe('cases from pug', function() {
37 testDir(__dirname + '/cases');

Callers 1

index.test.jsFile · 0.85

Calls 2

linkFunction · 0.85
testFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…