mockingoose: Provides its own types (#39466)

This commit is contained in:
Alexander T
2019-10-26 17:35:25 +03:00
committed by Nathan Shively-Sanders
parent b208ae4625
commit 4c0bb173e6
5 changed files with 6 additions and 73 deletions

View File

@@ -2130,6 +2130,12 @@
"sourceRepoURL": "https://github.com/will-stone/mobx-cookie",
"asOfVersion": "1.1.1"
},
{
"libraryName": "mockingoose",
"typingsPackageName": "mockingoose",
"sourceRepoURL": "https://github.com/alonronin/mockingoose#readme",
"asOfVersion": "2.13.0"
},
{
"libraryName": "Moment",
"typingsPackageName": "moment",

View File

@@ -1,40 +0,0 @@
// Type definitions for mockingoose 2.11
// Project: https://github.com/alonronin/mockingoose#readme
// Definitions by: Hiroshi Ioka <https://github.com/hirochachacha>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
type Op =
| 'find'
| 'findOne'
| 'count'
| 'countDocuments'
| 'estimatedDocumentCount'
| 'distinct'
| 'findOneAndUpdate'
| 'findOneAndRemove'
| 'remove'
| 'update'
| 'deleteOne'
| 'deleteMany'
| 'save';
declare class Mock {
toReturn(expected: any, op?: Op): this;
reset(op: Op): this;
toJSON(): any;
}
interface Target {
__mocks: any;
resetAll(): void;
toJSON(): any;
}
type Proxy = Target & {
[index: string]: Mock;
};
declare const mockingoose: Proxy;
export default mockingoose;

View File

@@ -1,9 +0,0 @@
import mockingoose from 'mockingoose';
mockingoose.User
.toReturn({ name: 'name' })
.toReturn({ name: 'a name too' }, 'findOne')
.toReturn({ name: 'another name' }, 'save')
.reset('find');
mockingoose.resetAll();

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",
"mockingoose-tests.ts"
]
}

View File

@@ -1 +0,0 @@
{ "extends": "dtslint/dt.json" }