-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(test): modernizes test setup
- Loading branch information
Showing
5 changed files
with
18 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
/* eslint max-len:0 */ | ||
const sampleListReader = require('../../interpreter/sampleListReader') | ||
const fixture = require('./sampleListReaderFixture.json') | ||
const expect = require('chai').expect | ||
const assert = require('node:assert/strict') | ||
const { describe, it } = require('node:test') | ||
// kutjelikken is | ||
|
||
describe('sampleListReader', function () { | ||
const OPTIONS_NO_DEBUG_FIXTURE = '<optgroup label="first option group"><option value="samples/debug-not-specified.mscgen">debug not specified</option><option value="samples/debug-false-sample.mscgen">debug false</option></optgroup><optgroup label="second option group"><option value="getikt">mesjogge</option><option value="leip">knetter</option></optgroup>' | ||
const OPTIONS_DEBUG_FIXTURE = '<optgroup label="first option group"><option value="samples/debug-not-specified.mscgen">debug not specified</option><option value="samples/debug-false-sample.mscgen">debug false</option><option value="samples/debug-true-sample.mscgen">debug true</option></optgroup><optgroup label="second option group"><option value="getikt">mesjogge</option><option value="leip">knetter</option></optgroup>' | ||
|
||
it('should return no debug options when debug not specified', function () { | ||
expect(sampleListReader.toOptionList(fixture)).to.equal(OPTIONS_NO_DEBUG_FIXTURE) | ||
assert.deepEqual(sampleListReader.toOptionList(fixture), OPTIONS_NO_DEBUG_FIXTURE) | ||
}) | ||
it('should return no debug options when debug false', function () { | ||
expect(sampleListReader.toOptionList(fixture, false)).to.equal(OPTIONS_NO_DEBUG_FIXTURE) | ||
assert.deepEqual(sampleListReader.toOptionList(fixture, false), OPTIONS_NO_DEBUG_FIXTURE) | ||
}) | ||
it('should also return debug options when debug true', function () { | ||
expect(sampleListReader.toOptionList(fixture, true)).to.equal(OPTIONS_DEBUG_FIXTURE) | ||
assert.deepEqual(sampleListReader.toOptionList(fixture, true), OPTIONS_DEBUG_FIXTURE) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters