deno.land / x / mongoose@6.7.5 / test / types / base.test.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import * as mongoose from 'mongoose';import { expectError, expectType } from 'tsd';
Object.values(mongoose.models).forEach(model => { model.modelName; model.findOne();});
mongoose.pluralize(null);
function gh10746() { type A = string extends Function ? never : string;
let testVar: A; testVar = 'A string'; testVar = 'B string'; expectType<string>(testVar);}
function gh10957() { type TestType = { name: string }; const obj: TestType = { name: 'foo' };
expectType<TestType>(mongoose.trusted(obj));}
function connectionStates() { const m: mongoose.Mongoose = new mongoose.Mongoose();
m.STATES.connected; m.ConnectionStates.connected;
m.connect('mongodb://localhost:27017/test').then(() => { console.log('Connected!'); });
m.syncIndexes().then(() => console.log('Synced indexes!'));
m.Promise = Promise;}function gh11478() { mongoose.set('allowDiskUse', false); mongoose.set('allowDiskUse', true);}
function gh10139() { mongoose.set('timestamps.createdAt.immutable', false);}
function gh12100() { mongoose.syncIndexes({ continueOnError: true, noResponse: true }); mongoose.syncIndexes({ continueOnError: false, noResponse: true });}
function setAsObject() { mongoose.set({ debug: true, autoIndex: false });
expectError(mongoose.set({ invalid: true }));}
mongoose

Version Info

Tagged at
a year ago