@@ -14,14 +14,15 @@ const __dirname = path.dirname(__filename);
14
14
describe ( 'aspnet-oauth:app' , ( ) => {
15
15
before ( async function ( ) {
16
16
this . timeout ( 10000 ) ;
17
- await helpers . run ( path . join ( __dirname , '../generators/app' ) )
17
+ await helpers
18
+ . run ( path . join ( __dirname , '../generators/app' ) )
18
19
. withOptions ( { skipInstall : true } )
19
20
. withAnswers ( {
20
21
name : 'Foo' ,
21
22
authorname : 'John Smith' ,
22
23
authorizationendpoint : 'https://foo.local/auth' ,
23
24
tokenendpoint : 'https://foo.local/token' ,
24
- userinformationendpoint : 'https://foo.local/user'
25
+ userinformationendpoint : 'https://foo.local/user' ,
25
26
} ) ;
26
27
} ) ;
27
28
@@ -31,7 +32,7 @@ describe('aspnet-oauth:app', () => {
31
32
'AspNet.Security.OAuth.Foo/FooAuthenticationDefaults.cs' ,
32
33
'AspNet.Security.OAuth.Foo/FooAuthenticationExtensions.cs' ,
33
34
'AspNet.Security.OAuth.Foo/FooAuthenticationHandler.cs' ,
34
- 'AspNet.Security.OAuth.Foo/FooAuthenticationOptions.cs'
35
+ 'AspNet.Security.OAuth.Foo/FooAuthenticationOptions.cs' ,
35
36
] ) ;
36
37
} ) ;
37
38
it ( 'sets the authors name' , ( ) => {
@@ -144,7 +145,6 @@ describe('aspnet-oauth:app', () => {
144
145
} ) ;
145
146
146
147
describe ( 'generating a new provider' , ( ) => {
147
-
148
148
const projectName = 'AspNet.Security.OAuth.Foo' ;
149
149
const tempDir = path . join ( os . tmpdir ( ) , `_generator-aspnet-oauth-${ Math . random ( ) } ` ) ;
150
150
const artifactsDir = path . join ( tempDir , 'artifacts' ) ;
@@ -156,32 +156,36 @@ describe('aspnet-oauth:app', () => {
156
156
this . timeout ( 180000 ) ;
157
157
158
158
// Clone the providers repository to add the project to
159
- const clone = spawnSync (
160
- 'git' ,
161
- [ 'clone' , 'https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers.git' , tempDir ] ) ;
159
+ const clone = spawnSync ( 'git' , [
160
+ 'clone' ,
161
+ 'https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers.git' ,
162
+ tempDir ,
163
+ ] ) ;
162
164
163
165
if ( clone . status !== 0 && clone . output ) {
164
166
console . error ( clone . output . toString ( 'utf8' ) ) ;
165
167
}
166
168
assert . strictEqual ( clone . status , 0 ) ;
167
169
168
170
// Run the generator to create the project
169
- context = await helpers . run ( path . join ( __dirname , '../generators/app' ) , { tmpdir : false } )
171
+ context = await helpers
172
+ . run ( path . join ( __dirname , '../generators/app' ) , { tmpdir : false } )
170
173
. cd ( sourceDir )
171
174
. withOptions ( { skipInstall : true } )
172
175
. withPrompts ( {
173
176
name : 'Foo' ,
174
177
authorname : 'John Smith' ,
175
178
authorizationendpoint : 'https://foo.local/auth' ,
176
179
tokenendpoint : 'https://foo.local/token' ,
177
- userinformationendpoint : 'https://foo.local/user'
180
+ userinformationendpoint : 'https://foo.local/user' ,
178
181
} ) ;
179
182
180
183
// Add the new project to the solution
181
184
const dotnetSlnAdd = spawnSync (
182
185
`dotnet` ,
183
186
[ 'sln' , 'add' , path . join ( projectDir , `${ projectName } .csproj` ) ] ,
184
- { cwd : tempDir } ) ;
187
+ { cwd : tempDir }
188
+ ) ;
185
189
186
190
if ( dotnetSlnAdd . status !== 0 ) {
187
191
console . error ( dotnetSlnAdd . output . toString ( 'utf8' ) ) ;
@@ -192,9 +196,14 @@ describe('aspnet-oauth:app', () => {
192
196
let build ;
193
197
194
198
if ( process . platform === 'win32' ) {
195
- build = spawnSync ( 'build.cmd' , [ '-test' , '-pack' , '-configuration' , configuration ] , { cwd : tempDir , shell : true } ) ;
199
+ build = spawnSync ( 'build.cmd' , [ '-test' , '-pack' , '-configuration' , configuration ] , {
200
+ cwd : tempDir ,
201
+ shell : true ,
202
+ } ) ;
196
203
} else {
197
- build = spawnSync ( './build.sh' , [ '--test' , '--pack' , '--configuration' , configuration ] , { cwd : tempDir } ) ;
204
+ build = spawnSync ( './build.sh' , [ '--test' , '--pack' , '--configuration' , configuration ] , {
205
+ cwd : tempDir ,
206
+ } ) ;
198
207
}
199
208
200
209
if ( build . status !== 0 && build . output ) {
@@ -204,15 +213,33 @@ describe('aspnet-oauth:app', () => {
204
213
} ) ;
205
214
206
215
it ( 'compiles the provider' , async ( ) => {
207
- const expected = path . join ( artifactsDir , 'bin' , projectName , configuration , 'net*' , `${ projectName } .dll` ) ;
216
+ const expected = path . join (
217
+ artifactsDir ,
218
+ 'bin' ,
219
+ projectName ,
220
+ configuration ,
221
+ 'net*' ,
222
+ `${ projectName } .dll`
223
+ ) ;
208
224
await glob ( expected ) ;
209
225
} ) ;
210
226
it ( 'generates the NuGet package' , async ( ) => {
211
- const expected = path . join ( artifactsDir , 'packages' , configuration , 'Shipping' , `${ projectName } .*.nupkg` ) ;
227
+ const expected = path . join (
228
+ artifactsDir ,
229
+ 'packages' ,
230
+ configuration ,
231
+ 'Shipping' ,
232
+ `${ projectName } .*.nupkg`
233
+ ) ;
212
234
await glob ( expected ) ;
213
235
} ) ;
214
236
it ( 'runs the tests' , async ( ) => {
215
- const expected = path . join ( artifactsDir , 'TestResults' , configuration , 'AspNet.Security.OAuth.Providers.Tests_net*_x64.html' ) ;
237
+ const expected = path . join (
238
+ artifactsDir ,
239
+ 'TestResults' ,
240
+ configuration ,
241
+ 'AspNet.Security.OAuth.Providers.Tests_net*_x64.html'
242
+ ) ;
216
243
await glob ( expected ) ;
217
244
} ) ;
218
245
} ) ;
0 commit comments