Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/expression/types/color_array.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ describe('ColorArray', () => {

expect(() => {
ColorArray.interpolate(colorArray, targetColorArray, 0.5);
}).toThrow('colorArray: Arrays have mismatched length (2 vs. 1), cannot interpolate.');
}).toThrowError('colorArray: Arrays have mismatched length (2 vs. 1), cannot interpolate.');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ describe('VariableAnchorOffsetCollection', () => {
test('should throw with mismatched endpoints', () => {
expect(() =>
i11nFn(parseFn(['top', [0, 0]]), parseFn(['bottom', [1, 1]]), 0.5)
).toThrow(
).toThrowError(
'Cannot interpolate values containing mismatched anchors. from[0]: top, to[0]: bottom'
);
expect(() =>
i11nFn(parseFn(['top', [0, 0]]), parseFn(['top', [1, 1], 'bottom', [2, 2]]), 0.5)
).toThrow(
).toThrowError(
'Cannot interpolate values of different length. from: ["top",[0,0]], to: ["top",[1,1],"bottom",[2,2]]'
);
});
Expand Down
6 changes: 3 additions & 3 deletions src/feature_filter/feature_filter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ describe('filter', () => {
test('expression, type error', () => {
expect(() => {
featureFilter(['==', ['number', ['get', 'x']], ['string', ['get', 'y']]]);
}).toThrow();
}).toThrowError(': Cannot compare types \'number\' and \'string\'.');

expect(() => {
featureFilter(['number', ['get', 'x']]);
}).toThrow();
}).toThrowError(": Expected boolean but found number instead.");

expect(() => {
featureFilter(['boolean', ['get', 'x']]);
}).not.toThrow();
}).not.toThrowError();
});

test('expression, within', () => {
Expand Down
6 changes: 3 additions & 3 deletions src/function/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ describe('exponential function', () => {
type: 'color'
}
);
}).toThrow('Unknown color space: "invalid"');
}).toThrowError('Unknown color space: "invalid"');
});

test('exponential interpolation of colorArray', () => {
Expand Down Expand Up @@ -367,7 +367,7 @@ describe('exponential function', () => {
type: 'colorArray'
}
);
}).toThrow('Unknown color space: "invalid"');
}).toThrowError('Unknown color space: "invalid"');
});

test('exponential interpolation of numberArray', () => {
Expand Down Expand Up @@ -1536,7 +1536,7 @@ test('unknown function', () => {
type: 'string'
}
)
).toThrow(/Unknown function type "nonesuch"/);
).toThrowError(/Unknown function type "nonesuch"/);
});

describe('kind', () => {
Expand Down
6 changes: 3 additions & 3 deletions src/migrate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ describe('migrate', () => {
test('does not migrate from version 5', () => {
expect(() => {
migrate({version: 5, layers: []} as any);
}).toThrow(new Error('Cannot migrate from 5'));
}).toThrowError('Cannot migrate from 5');
});

test('does not migrate from version 6', () => {
expect(() => {
migrate({version: 6, layers: []} as any);
}).toThrow(new Error('Cannot migrate from 6'));
}).toThrowError('Cannot migrate from 6');
});

test('migrates to latest version from version 7', () => {
Expand Down Expand Up @@ -181,7 +181,7 @@ describe('migrate', () => {
]
};

expect(() => migrate(style)).not.toThrow();
expect(() => migrate(style)).not.toThrowError();
expect(style.layers[0].paint).toEqual({
'icon-color': 'hsl(100,30%,20%)',
'icon-opacity-transition': {duration: 0}
Expand Down