@@ -26,39 +26,34 @@ describe('cli', function () {
26
26
} ) ;
27
27
28
28
it ( 'should show output for failures' , async ( ) => {
29
- const res = await execa ( 'npx' , [ ' linkinator', 'test/fixtures/basic' ] , {
29
+ const res = await execa ( 'linkinator' , [ 'test/fixtures/basic' ] , {
30
30
reject : false ,
31
31
} ) ;
32
32
assert . match ( res . stderr , / E R R O R : D e t e c t e d 1 b r o k e n l i n k s / ) ;
33
33
} ) ;
34
34
35
35
it ( 'should pass successful markdown scan' , async ( ) => {
36
- const res = await execa ( 'npx' , [
37
- 'linkinator' ,
38
- 'test/fixtures/markdown/README.md' ,
39
- ] ) ;
36
+ const res = await execa ( 'linkinator' , [ 'test/fixtures/markdown/README.md' ] ) ;
40
37
assert . match ( res . stderr , / S u c c e s s f u l l y s c a n n e d / ) ;
41
38
} ) ;
42
39
43
40
it ( 'should allow multiple paths' , async ( ) => {
44
- const res = await execa ( 'npx' , [
45
- 'linkinator' ,
41
+ const res = await execa ( 'linkinator' , [
46
42
'test/fixtures/markdown/unlinked.md' ,
47
43
'test/fixtures/markdown/README.md' ,
48
44
] ) ;
49
45
assert . match ( res . stderr , / S u c c e s s f u l l y s c a n n e d / ) ;
50
46
} ) ;
51
47
52
48
it ( 'should show help if no params are provided' , async ( ) => {
53
- const res = await execa ( 'npx' , [ ' linkinator'] , {
49
+ const res = await execa ( 'linkinator' , {
54
50
reject : false ,
55
51
} ) ;
56
52
assert . match ( res . stdout , / \$ l i n k i n a t o r L O C A T I O N \[ - - a r g u m e n t s \] / ) ;
57
53
} ) ;
58
54
59
55
it ( 'should flag skipped links' , async ( ) => {
60
- const res = await execa ( 'npx' , [
61
- 'linkinator' ,
56
+ const res = await execa ( 'linkinator' , [
62
57
'--verbosity' ,
63
58
'INFO' ,
64
59
'--skip' ,
@@ -69,8 +64,7 @@ describe('cli', function () {
69
64
} ) ;
70
65
71
66
it ( 'should provide CSV if asked nicely' , async ( ) => {
72
- const res = await execa ( 'npx' , [
73
- 'linkinator' ,
67
+ const res = await execa ( 'linkinator' , [
74
68
'--format' ,
75
69
'csv' ,
76
70
'test/fixtures/markdown/README.md' ,
@@ -79,8 +73,7 @@ describe('cli', function () {
79
73
} ) ;
80
74
81
75
it ( 'should provide JSON if asked nicely' , async ( ) => {
82
- const res = await execa ( 'npx' , [
83
- 'linkinator' ,
76
+ const res = await execa ( 'linkinator' , [
84
77
'--format' ,
85
78
'json' ,
86
79
'test/fixtures/markdown/README.md' ,
@@ -90,17 +83,15 @@ describe('cli', function () {
90
83
} ) ;
91
84
92
85
it ( 'should not show links if --silent' , async ( ) => {
93
- const res = await execa ( 'npx' , [
94
- 'linkinator' ,
86
+ const res = await execa ( 'linkinator' , [
95
87
'--silent' ,
96
88
'test/fixtures/markdown/README.md' ,
97
89
] ) ;
98
90
assert . notMatch ( res . stdout , / \[ / ) ;
99
91
} ) ;
100
92
101
93
it ( 'should not show 200 links if verbosity is ERROR with JSON' , async ( ) => {
102
- const res = await execa ( 'npx' , [
103
- 'linkinator' ,
94
+ const res = await execa ( 'linkinator' , [
104
95
'--verbosity' ,
105
96
'ERROR' ,
106
97
'--format' ,
@@ -114,8 +105,7 @@ describe('cli', function () {
114
105
} ) ;
115
106
116
107
it ( 'should accept a server-root' , async ( ) => {
117
- const res = await execa ( 'npx' , [
118
- 'linkinator' ,
108
+ const res = await execa ( 'linkinator' , [
119
109
'--markdown' ,
120
110
'--server-root' ,
121
111
'test/fixtures/markdown' ,
@@ -125,29 +115,24 @@ describe('cli', function () {
125
115
} ) ;
126
116
127
117
it ( 'should accept globs' , async ( ) => {
128
- const res = await execa ( 'npx' , [
129
- 'linkinator' ,
118
+ const res = await execa ( 'linkinator' , [
130
119
'test/fixtures/markdown/*.md' ,
131
120
'test/fixtures/markdown/**/*.md' ,
132
121
] ) ;
133
122
assert . match ( res . stderr , / S u c c e s s f u l l y s c a n n e d / ) ;
134
123
} ) ;
135
124
136
125
it ( 'should throw on invalid format' , async ( ) => {
137
- const res = await execa (
138
- 'npx' ,
139
- [ 'linkinator' , './README.md' , '--format' , 'LOL' ] ,
140
- {
141
- reject : false ,
142
- }
143
- ) ;
126
+ const res = await execa ( 'linkinator' , [ './README.md' , '--format' , 'LOL' ] , {
127
+ reject : false ,
128
+ } ) ;
144
129
assert . match ( res . stderr , / F O R M A T m u s t b e / ) ;
145
130
} ) ;
146
131
147
132
it ( 'should throw on invalid verbosity' , async ( ) => {
148
133
const res = await execa (
149
- 'npx ' ,
150
- [ 'linkinator' , ' ./README.md', '--VERBOSITY' , 'LOL' ] ,
134
+ 'linkinator ' ,
135
+ [ './README.md' , '--VERBOSITY' , 'LOL' ] ,
151
136
{
152
137
reject : false ,
153
138
}
@@ -157,8 +142,8 @@ describe('cli', function () {
157
142
158
143
it ( 'should throw when verbosity and silent are flagged' , async ( ) => {
159
144
const res = await execa (
160
- 'npx ' ,
161
- [ 'linkinator' , ' ./README.md', '--verbosity' , 'DEBUG' , '--silent' ] ,
145
+ 'linkinator ' ,
146
+ [ './README.md' , '--verbosity' , 'DEBUG' , '--silent' ] ,
162
147
{
163
148
reject : false ,
164
149
}
@@ -168,8 +153,8 @@ describe('cli', function () {
168
153
169
154
it ( 'should show no output for verbosity=NONE' , async ( ) => {
170
155
const res = await execa (
171
- 'npx ' ,
172
- [ 'linkinator' , ' test/fixtures/basic', '--verbosity' , 'NONE' ] ,
156
+ 'linkinator ' ,
157
+ [ 'test/fixtures/basic' , '--verbosity' , 'NONE' ] ,
173
158
{
174
159
reject : false ,
175
160
}
@@ -181,8 +166,8 @@ describe('cli', function () {
181
166
182
167
it ( 'should show callstacks for verbosity=DEBUG' , async ( ) => {
183
168
const res = await execa (
184
- 'npx ' ,
185
- [ 'linkinator' , ' test/fixtures/basic', '--verbosity' , 'DEBUG' ] ,
169
+ 'linkinator ' ,
170
+ [ 'test/fixtures/basic' , '--verbosity' , 'DEBUG' ] ,
186
171
{
187
172
reject : false ,
188
173
}
@@ -192,8 +177,7 @@ describe('cli', function () {
192
177
} ) ;
193
178
194
179
it ( 'should allow passing a config' , async ( ) => {
195
- const res = await execa ( 'npx' , [
196
- 'linkinator' ,
180
+ const res = await execa ( 'linkinator' , [
197
181
'test/fixtures/basic' ,
198
182
'--config' ,
199
183
'test/fixtures/config/skip-array-config.json' ,
@@ -223,8 +207,7 @@ describe('cli', function () {
223
207
enableDestroy ( server ) ;
224
208
await new Promise < void > ( r => server . listen ( port , r ) ) ;
225
209
226
- const res = await execa ( 'npx' , [
227
- 'linkinator' ,
210
+ const res = await execa ( 'linkinator' , [
228
211
'--retry' ,
229
212
'test/fixtures/retryCLI' ,
230
213
] ) ;
0 commit comments