1
0
Fork 0
cautious-journey/test/TestResolve.ts

41 lines
994 B
TypeScript
Raw Normal View History

import { expect } from 'chai';
import { resolveProject } from '../src/resolve';
import { TEST_CASES } from './resolve/cases';
2020-08-29 15:33:30 +00:00
const TEST_LABELS = ['bar', 'foo'];
describe('resolve labels', () => {
describe('with empty rule set', () => {
it('should return the existing labels', () => {
const result = resolveProject({
flags: [],
labels: TEST_LABELS,
states: [],
});
expect(result.labels).to.deep.equal(TEST_LABELS);
});
it('should not make any changes', () => {
const result = resolveProject({
flags: [],
labels: TEST_LABELS,
states: [],
});
expect(result.changes.length).to.equal(0);
});
});
// procedural tests
describe('resolver test cases', () => {
for (const test of TEST_CASES) {
it(`should resolve ${test.name}`, () => {
const actualResult = resolveProject(test.input);
2020-08-29 07:16:53 +00:00
expect(actualResult).to.deep.include(test.result);
});
}
});
});