mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Add typings for jest-diff * Add typings for jest-get-type * Add typings for jest-matcher-utils * Enable noImplicitThis option for jest-diff * Enable noImplicitThis option for jest-get-type * Enable noImplicitThis option for jest-matcher-utils * Point jest-diff project URL to GitHub * Point jest-get=type project URL to GitHub * Point jest-matcher-utils project URL to GitHub * Uncomment EXPECTED_BG, RECEIVED_BG variables Although these variables have been removed on master of the jest-matcher-utils repo, there has yet to be a release. Add a TODO to indicate that a future update to these definitions will be necessary.
43 lines
1.0 KiB
TypeScript
43 lines
1.0 KiB
TypeScript
import diff = require('jest-diff');
|
|
|
|
diff([], ['a']); // $ExpectType string
|
|
diff(false, true);
|
|
diff(null, null);
|
|
diff(1000, 1001);
|
|
diff(/d+/, /w+/);
|
|
diff(new Map(), new Map());
|
|
diff(new Set(), new Set());
|
|
diff(new Date(), new Date());
|
|
diff('ts', 'js');
|
|
diff(Symbol(), Symbol(1));
|
|
diff(undefined, undefined);
|
|
|
|
diff([], ['a'], { }); // $ExpectType string
|
|
diff([], ['a'], { expand: false }); // $ExpectType string
|
|
diff([], ['a'], { contextLines: 3 }); // $ExpectType string
|
|
// $ExpectType string
|
|
diff([], ['a'], {
|
|
aAnnotation: 'esperado',
|
|
bAnnotation: 'recibido'
|
|
});
|
|
|
|
diff(); // $ExpectError
|
|
diff([]); // $ExpectError
|
|
// diff([], {}, []); // $ExpectError (does not error on 2.3)
|
|
|
|
diff([], ['a'], { expand: false }); // $ExpectType string
|
|
diff([], ['a'], { contextLines: 3 }); // $ExpectType string
|
|
// $ExpectType string
|
|
diff([], ['a'], {
|
|
aAnnotation: 'esperado',
|
|
bAnnotation: 'recibido'
|
|
});
|
|
|
|
// $ExpectError
|
|
diff([], ['a'], {
|
|
expand: 'yeah',
|
|
aAnnotation: false,
|
|
bAnnotation: {},
|
|
contextLines: 'two'
|
|
});
|