mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-04-12 08:34:32 +00:00
mockingoose: Provides its own types (#39466)
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
b208ae4625
commit
4c0bb173e6
@@ -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",
|
||||
|
||||
40
types/mockingoose/index.d.ts
vendored
40
types/mockingoose/index.d.ts
vendored
@@ -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;
|
||||
@@ -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();
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user