Skip to content

Commit 8b62fd4

Browse files
committed
test(node-unit): add cli config parser test for .mjs
1 parent 5590fb2 commit 8b62fd4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/node-unit/cli/config.spec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ describe('cli/config', function () {
2828
sinon.stub(parsers, 'yaml').returns(phonyConfigObject);
2929
sinon.stub(parsers, 'json').returns(phonyConfigObject);
3030
sinon.stub(parsers, 'js').returns(phonyConfigObject);
31+
sinon.stub(parsers, 'mjs').returns(phonyConfigObject);
3132
});
3233

3334
describe('when supplied a filepath with ".yaml" extension', function () {
@@ -74,6 +75,17 @@ describe('cli/config', function () {
7475
});
7576
});
7677

78+
describe('when supplied a filepath with ".mjs" extension', function () {
79+
const filepath = 'foo.mjs';
80+
81+
it('should use the MJS parser', function () {
82+
loadConfig(filepath);
83+
expect(parsers.mjs, 'to have calls satisfying', [
84+
{args: [filepath], returned: phonyConfigObject}
85+
]).and('was called once');
86+
});
87+
});
88+
7789
describe('when supplied a filepath with ".jsonc" extension', function () {
7890
const filepath = 'foo.jsonc';
7991

0 commit comments

Comments
 (0)