-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.test-d.ts
80 lines (72 loc) · 5.11 KB
/
index.test-d.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import {expectType} from 'tsd';
import {
writePackage,
writePackageSync,
updatePackage,
updatePackageSync,
addPackageDependencies,
addPackageDependenciesSync,
removePackageDependencies,
removePackageDependenciesSync,
} from './index.js';
expectType<Promise<void>>(writePackage('package.json', {version: 1}));
expectType<Promise<void>>(writePackage('package.json', {version: '1.0.0'}));
expectType<Promise<void>>(writePackage('package.json', {version: 1}));
expectType<Promise<void>>(writePackage('package.json', {version: 1}, {normalize: false}));
expectType<Promise<void>>(writePackage('package.json', {version: 1}, {indent: 2}));
expectType<Promise<void>>(writePackage({version: 1}));
expectType<Promise<void>>(writePackage({version: 1}, {normalize: false}));
expectType<Promise<void>>(writePackage({version: 1}, {indent: 2}));
expectType<void>(writePackageSync('package.json', {version: 1}));
expectType<void>(writePackageSync('package.json', {version: '1.0.0'}));
expectType<void>(writePackageSync('package.json', {version: 1}, {normalize: false}));
expectType<void>(writePackageSync('package.json', {version: 1}, {indent: 2}));
expectType<void>(writePackageSync({version: 1}));
expectType<void>(writePackageSync({version: 1}, {normalize: false}));
expectType<void>(writePackageSync({version: 1}, {indent: 2}));
expectType<Promise<void>>(updatePackage('package.json', {version: 1}));
expectType<Promise<void>>(updatePackage('package.json', {version: '1.0.0'}));
expectType<Promise<void>>(updatePackage('package.json', {version: 1}, {normalize: false}));
expectType<Promise<void>>(updatePackage('package.json', {version: 1}, {indent: 2}));
expectType<Promise<void>>(updatePackage({version: 1}));
expectType<Promise<void>>(updatePackage({version: 1}, {normalize: false}));
expectType<Promise<void>>(updatePackage({version: 1}, {indent: 2}));
expectType<void>(updatePackageSync('package.json', {version: 1}));
expectType<void>(updatePackageSync('package.json', {version: '1.0.0'}));
expectType<void>(updatePackageSync('package.json', {version: 1}, {normalize: false}));
expectType<void>(updatePackageSync('package.json', {version: 1}, {indent: 2}));
expectType<void>(updatePackageSync({version: 1}));
expectType<void>(updatePackageSync({version: 1}, {normalize: false}));
expectType<void>(updatePackageSync({version: 1}, {indent: 2}));
expectType<Promise<void>>(addPackageDependencies('package.json', {foo: '1.0.0'}));
expectType<Promise<void>>(addPackageDependencies('package.json', {dependencies: {foo: '1.0.0'}, devDependencies: {bar: '1.0.0'}}));
expectType<Promise<void>>(addPackageDependencies('package.json', {foo: '1.0.0'}, {normalize: false}));
expectType<Promise<void>>(addPackageDependencies('package.json', {foo: '1.0.0'}, {indent: 2}));
expectType<Promise<void>>(addPackageDependencies({foo: '1.0.0'}));
expectType<Promise<void>>(addPackageDependencies({dependencies: {foo: '1.0.0'}, devDependencies: {bar: '1.0.0'}}));
expectType<Promise<void>>(addPackageDependencies({foo: '1.0.0'}, {normalize: false}));
expectType<Promise<void>>(addPackageDependencies({foo: '1.0.0'}, {indent: 2}));
expectType<void>(addPackageDependenciesSync('package.json', {foo: '1.0.0'}));
expectType<void>(addPackageDependenciesSync('package.json', {dependencies: {foo: '1.0.0'}, devDependencies: {bar: '1.0.0'}}));
expectType<void>(addPackageDependenciesSync('package.json', {foo: '1.0.0'}, {normalize: false}));
expectType<void>(addPackageDependenciesSync('package.json', {foo: '1.0.0'}, {indent: 2}));
expectType<void>(addPackageDependenciesSync({foo: '1.0.0'}));
expectType<void>(addPackageDependenciesSync({dependencies: {foo: '1.0.0'}, devDependencies: {bar: '1.0.0'}}));
expectType<void>(addPackageDependenciesSync({foo: '1.0.0'}, {normalize: false}));
expectType<void>(addPackageDependenciesSync({foo: '1.0.0'}, {indent: 2}));
expectType<Promise<void>>(removePackageDependencies('package.json', ['foo']));
expectType<Promise<void>>(removePackageDependencies('package.json', {dependencies: ['foo'], devDependencies: ['bar']}));
expectType<Promise<void>>(removePackageDependencies('package.json', ['foo'], {normalize: false}));
expectType<Promise<void>>(removePackageDependencies('package.json', ['foo'], {indent: 2}));
expectType<Promise<void>>(removePackageDependencies(['foo']));
expectType<Promise<void>>(removePackageDependencies({dependencies: ['foo'], devDependencies: ['bar']}));
expectType<Promise<void>>(removePackageDependencies(['foo'], {normalize: false}));
expectType<Promise<void>>(removePackageDependencies(['foo'], {indent: 2}));
expectType<void>(removePackageDependenciesSync('package.json', ['foo']));
expectType<void>(removePackageDependenciesSync('package.json', {dependencies: ['foo'], devDependencies: ['bar']}));
expectType<void>(removePackageDependenciesSync('package.json', ['foo'], {normalize: false}));
expectType<void>(removePackageDependenciesSync('package.json', ['foo'], {indent: 2}));
expectType<void>(removePackageDependenciesSync(['foo']));
expectType<void>(removePackageDependenciesSync({dependencies: ['foo'], devDependencies: ['bar']}));
expectType<void>(removePackageDependenciesSync(['foo'], {normalize: false}));
expectType<void>(removePackageDependenciesSync(['foo'], {indent: 2}));