jest-diff: Provides its own types (#39589)

This commit is contained in:
Alexander T
2019-11-12 12:42:32 -08:00
committed by Pranav Senthilnathan
parent 27cff735cb
commit 0acbec3d02
6 changed files with 12 additions and 86 deletions
+6
View File
@@ -2148,6 +2148,12 @@
"sourceRepoURL": "https://github.com/dmester/jdenticon",
"asOfVersion": "2.2.0"
},
{
"libraryName": "jest-diff",
"typingsPackageName": "jest-diff",
"sourceRepoURL": "https://github.com/facebook/jest/tree/master/packages/jest-diff",
"asOfVersion": "24.3.0"
},
{
"libraryName": "jest-get-type",
"typingsPackageName": "jest-get-type",
-18
View File
@@ -1,18 +0,0 @@
// Type definitions for jest-diff 20.0
// Project: https://github.com/facebook/jest/tree/master/packages/jest-diff, https://github.com/facebook/jest
// Definitions by: Alex Coles <https://github.com/myabc>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
declare namespace diff {
interface DiffOptions {
aAnnotation?: string;
bAnnotation?: string;
expand?: boolean;
contextLines?: number;
}
}
declare function diff(a: any, b: any, options?: diff.DiffOptions): string;
export = diff;
-42
View File
@@ -1,42 +0,0 @@
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'
});
-23
View File
@@ -1,23 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"jest-diff-tests.ts"
]
}
-3
View File
@@ -1,3 +0,0 @@
{
"extends": "dtslint/dt.json"
}
+6
View File
@@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"jest-diff": "^24.3.0"
}
}