Skip to content

Commit

Permalink
feat(maps): add ENABLE_MAP_TYPE env var for test run
Browse files Browse the repository at this point in the history
Signed-off-by: jonathan.casey <[email protected]>
  • Loading branch information
jonathan-casey committed Aug 22, 2023
1 parent 70a681c commit 86ce693
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/concerto-analysis/test/unit/compare.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ test('should detect a change of namespace', async () => {

['asset', 'concept', 'enum', 'event', 'participant', 'transaction', 'map'].forEach(type => {
test(`should detect a ${type} being added`, async () => {
process.env.ENABLE_MAP_TYPE = 'true'; // TODO Remove on release of MapType
const [a, b] = await getModelFiles('empty.cto', `${type}-added.cto`);
const results = new Compare().compare(a, b);
expect(results.findings).toEqual(expect.arrayContaining([
Expand Down Expand Up @@ -230,6 +231,7 @@ test('should detect an array changing to a scalar', async () => {
});

test('should detect a map key type changing from x to y', async () => {
process.env.ENABLE_MAP_TYPE = 'true'; // TODO Remove on release of MapType
const [a, b] = await getModelFiles('map-added.cto', 'map-changed-key.cto');
const results = new Compare().compare(a, b);
expect(results.findings).toEqual(expect.arrayContaining([
Expand All @@ -242,6 +244,7 @@ test('should detect a map key type changing from x to y', async () => {
});

test('should detect a map value type changing from x to y', async () => {
process.env.ENABLE_MAP_TYPE = 'true'; // TODO Remove on release of MapType
const [a, b] = await getModelFiles('map-added.cto', 'map-changed-value.cto');
const results = new Compare().compare(a, b);
expect(results.findings).toEqual(expect.arrayContaining([
Expand Down

0 comments on commit 86ce693

Please sign in to comment.