mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
parent
6a7f81cc29
commit
68df4292b5
1 changed files with 13 additions and 7 deletions
|
@ -21,16 +21,22 @@ import { resolve } from 'path';
|
|||
|
||||
import execa from 'execa';
|
||||
|
||||
it('types return values to prevent mutations in typescript', async () => {
|
||||
await expect(
|
||||
execa.stdout('tsc', ['--noEmit'], {
|
||||
cwd: resolve(__dirname, '__fixtures__/frozen_object_mutation'),
|
||||
})
|
||||
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
||||
const MINUTE = 60 * 1000;
|
||||
|
||||
it(
|
||||
'types return values to prevent mutations in typescript',
|
||||
async () => {
|
||||
await expect(
|
||||
execa.stdout('tsc', ['--noEmit'], {
|
||||
cwd: resolve(__dirname, '__fixtures__/frozen_object_mutation'),
|
||||
})
|
||||
).rejects.toThrowErrorMatchingInlineSnapshot(`
|
||||
"Command failed: tsc --noEmit
|
||||
|
||||
index.ts(30,11): error TS2540: Cannot assign to 'baz' because it is a read-only property.
|
||||
index.ts(40,10): error TS2540: Cannot assign to 'bar' because it is a read-only property.
|
||||
"
|
||||
`);
|
||||
});
|
||||
},
|
||||
MINUTE
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue