@@ -20,7 +20,7 @@ import * as assert from 'assert';
20
20
import * as fs from 'fs' ;
21
21
import * as path from 'path' ;
22
22
import { accessSync } from 'fs' ;
23
- import { PackageJson } from '@npm/types' ;
23
+ import { PackageJSON } from '@npm/types' ;
24
24
import { withFixtures , Fixtures } from 'inline-fixtures' ;
25
25
import { describe , it , beforeEach , afterEach } from 'mocha' ;
26
26
@@ -41,7 +41,7 @@ const OPTIONS_NO = Object.assign({}, OPTIONS, {no: true});
41
41
const OPTIONS_YARN = Object . assign ( { } , OPTIONS_YES , { yarn : true } ) ;
42
42
const MINIMAL_PACKAGE_JSON = { name : 'name' , version : 'v1.1.1' } ;
43
43
44
- function hasExpectedScripts ( packageJson : PackageJson ) : boolean {
44
+ function hasExpectedScripts ( packageJson : PackageJSON ) : boolean {
45
45
return (
46
46
! ! packageJson . scripts &&
47
47
[ 'lint' , 'clean' , 'compile' , 'fix' , 'prepare' , 'pretest' , 'posttest' ] . every (
@@ -50,7 +50,7 @@ function hasExpectedScripts(packageJson: PackageJson): boolean {
50
50
) ;
51
51
}
52
52
53
- function hasExpectedDependencies ( packageJson : PackageJson ) : boolean {
53
+ function hasExpectedDependencies ( packageJson : PackageJSON ) : boolean {
54
54
return (
55
55
! ! packageJson . devDependencies &&
56
56
[ 'gts' , 'typescript' ] . every ( d => ! ! packageJson . devDependencies ! [ d ] )
@@ -69,7 +69,7 @@ describe('init', () => {
69
69
} ) ;
70
70
71
71
it ( 'addScripts should add a scripts section if none exists' , async ( ) => {
72
- const pkg : PackageJson = { ...MINIMAL_PACKAGE_JSON } ;
72
+ const pkg : PackageJSON = { ...MINIMAL_PACKAGE_JSON } ;
73
73
const result = await init . addScripts ( pkg , OPTIONS ) ;
74
74
assert . strictEqual ( result , true ) ; // made edits.
75
75
assert . ok ( pkg . scripts ) ;
@@ -86,7 +86,7 @@ describe('init', () => {
86
86
pretest : 'fake run compile' ,
87
87
posttest : 'fake run lint' ,
88
88
} ;
89
- const pkg : PackageJson = {
89
+ const pkg : PackageJSON = {
90
90
...MINIMAL_PACKAGE_JSON ,
91
91
scripts : { ...SCRIPTS } ,
92
92
} ;
@@ -105,7 +105,7 @@ describe('init', () => {
105
105
pretest : 'fake run compile' ,
106
106
posttest : 'fake run lint' ,
107
107
} ;
108
- const pkg : PackageJson = {
108
+ const pkg : PackageJSON = {
109
109
...MINIMAL_PACKAGE_JSON ,
110
110
scripts : { ...SCRIPTS } ,
111
111
} ;
@@ -115,7 +115,7 @@ describe('init', () => {
115
115
} ) ;
116
116
117
117
it ( 'addDependencies should add a deps section if none exists' , async ( ) => {
118
- const pkg : PackageJson = { ...MINIMAL_PACKAGE_JSON } ;
118
+ const pkg : PackageJSON = { ...MINIMAL_PACKAGE_JSON } ;
119
119
const result = await init . addDependencies ( pkg , OPTIONS ) ;
120
120
assert . strictEqual ( result , true ) ; // made edits.
121
121
assert . ok ( pkg . devDependencies ) ;
@@ -127,7 +127,7 @@ describe('init', () => {
127
127
typescript : 'or the other' ,
128
128
'@types/node' : 'or another' ,
129
129
} ;
130
- const pkg : PackageJson = {
130
+ const pkg : PackageJSON = {
131
131
...MINIMAL_PACKAGE_JSON ,
132
132
devDependencies : { ...DEPS } ,
133
133
} ;
@@ -139,7 +139,7 @@ describe('init', () => {
139
139
140
140
it ( 'addDependencies should edit existing deps on yes' , async ( ) => {
141
141
const DEPS = { gts : 'something' , typescript : 'or the other' } ;
142
- const pkg : PackageJson = {
142
+ const pkg : PackageJSON = {
143
143
...MINIMAL_PACKAGE_JSON ,
144
144
devDependencies : { ...DEPS } ,
145
145
} ;
0 commit comments