Skip to content

Commit c74a20e

Browse files
committed
Adding chai-files.
1 parent 0c413b1 commit c74a20e

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

package-lock.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"twig": "^1.17.1"
2424
},
2525
"devDependencies": {
26+
"chai-files": "^1.4.0",
2627
"jsdoc": "^4.0.2"
2728
}
2829
}

test/configuration/ConfigurationConvertorTest.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { assert } from 'chai';
2+
import { file } from 'chai-files';
23
import { dirname } from 'path';
34
import { fileURLToPath } from 'url';
5+
import { readFile } from 'node:fs/promises';
46
import ConfigurationConvertor from '../../lib/configuration/ConfigurationConvertor.js';
57
import TestConfiguration from '../../lib/configuration/TestConfiguration.js';
68
import ParsedConfiguration from '../../lib/parser/ParsedConfiguration.js';
@@ -146,17 +148,7 @@ suite("ConfigurationConvertor", function() {
146148

147149
assert.strictEqual(
148150
generatorCodeConfiguration.defaultCode,
149-
`const L = parseInt(readline());
150-
const H = parseInt(readline());
151-
const T = readline();
152-
for (let i = 0; i < H; i++) {
153-
const ROW = readline();
154-
}
155-
156-
// Write an answer using console.log()
157-
// To debug: console.error('Debug messages...');
158-
159-
console.log('answer');`
151+
file(__dirname + '../generator/example/CGCodeIndented.dist').content
160152
);
161153
});
162154
});

0 commit comments

Comments
 (0)