Skip to content

Commit 56ae872

Browse files
committed
use expectAssignable instead of expectType
1 parent d0ba75f commit 56ae872

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

test/types/index_options.test-d.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
import { expectType, expectNotType } from 'tsd';
1+
import { expectAssignable, expectNotAssignable } from 'tsd';
22
import type { IndexDescription } from '../../src';
33

4-
// test that all valid index options are allowed in IndexDefinitions
5-
expectType<IndexDescription>({ key: {}, background: true });
6-
expectType<IndexDescription>({ key: {}, expireAfterSeconds: 2400 });
7-
expectType<IndexDescription>({ key: {}, name: 'index_1' });
8-
expectType<IndexDescription>({ key: {}, sparse: true });
9-
expectType<IndexDescription>({ key: {}, storageEngine: {} });
10-
expectType<IndexDescription>({ key: {}, unique: true });
11-
expectType<IndexDescription>({ key: {}, version: 1 });
12-
expectType<IndexDescription>({ key: {}, default_language: 'english' });
13-
expectType<IndexDescription>({ key: {}, language_override: 'english' });
14-
expectType<IndexDescription>({ key: {}, textIndexVersion: 2 });
15-
expectType<IndexDescription>({ key: {}, weights: {} });
16-
expectType<IndexDescription>({ key: {}, '2dsphereIndexVersion': 2 });
17-
expectType<IndexDescription>({ key: {}, bits: 1 });
18-
expectType<IndexDescription>({ key: {}, max: 1.1 });
19-
expectType<IndexDescription>({ key: {}, min: 9.9 });
20-
expectType<IndexDescription>({ key: {}, bucketSize: 100 });
21-
expectType<IndexDescription>({ key: {}, partialFilterExpression: {} });
22-
expectType<IndexDescription>({ key: {}, collation: { locale: 'en' } });
23-
expectType<IndexDescription>({ key: {}, wildcardProjection: {} });
24-
expectType<IndexDescription>({ key: {}, hidden: true });
25-
expectNotType<IndexDescription>({ key: {}, invalidOption: 2400 });
4+
// test that all valid index options are allowed in IndexDescription
5+
expectAssignable<IndexDescription>({ key: {}, background: true });
6+
expectAssignable<IndexDescription>({ key: {}, expireAfterSeconds: 2400 });
7+
expectAssignable<IndexDescription>({ key: {}, name: 'index_1' });
8+
expectAssignable<IndexDescription>({ key: {}, sparse: true });
9+
expectAssignable<IndexDescription>({ key: {}, storageEngine: {} });
10+
expectAssignable<IndexDescription>({ key: {}, unique: true });
11+
expectAssignable<IndexDescription>({ key: {}, version: 1 });
12+
expectAssignable<IndexDescription>({ key: {}, default_language: 'english' });
13+
expectAssignable<IndexDescription>({ key: {}, language_override: 'english' });
14+
expectAssignable<IndexDescription>({ key: {}, textIndexVersion: 2 });
15+
expectAssignable<IndexDescription>({ key: {}, weights: {} });
16+
expectAssignable<IndexDescription>({ key: {}, '2dsphereIndexVersion': 2 });
17+
expectAssignable<IndexDescription>({ key: {}, bits: 1 });
18+
expectAssignable<IndexDescription>({ key: {}, max: 1.1 });
19+
expectAssignable<IndexDescription>({ key: {}, min: 9.9 });
20+
expectAssignable<IndexDescription>({ key: {}, bucketSize: 100 });
21+
expectAssignable<IndexDescription>({ key: {}, partialFilterExpression: {} });
22+
expectAssignable<IndexDescription>({ key: {}, collation: { locale: 'en' } });
23+
expectAssignable<IndexDescription>({ key: {}, wildcardProjection: {} });
24+
expectAssignable<IndexDescription>({ key: {}, hidden: true });
25+
expectNotAssignable<IndexDescription>({ key: {}, invalidOption: 2400 });

0 commit comments

Comments
 (0)