@@ -14,14 +14,15 @@ const __dirname = path.dirname(__filename);
1414describe ( 'aspnet-oauth:app' , ( ) => {
1515 before ( async function ( ) {
1616 this . timeout ( 10000 ) ;
17- await helpers . run ( path . join ( __dirname , '../generators/app' ) )
17+ await helpers
18+ . run ( path . join ( __dirname , '../generators/app' ) )
1819 . withOptions ( { skipInstall : true } )
1920 . withAnswers ( {
2021 name : 'Foo' ,
2122 authorname : 'John Smith' ,
2223 authorizationendpoint : 'https://foo.local/auth' ,
2324 tokenendpoint : 'https://foo.local/token' ,
24- userinformationendpoint : 'https://foo.local/user'
25+ userinformationendpoint : 'https://foo.local/user' ,
2526 } ) ;
2627 } ) ;
2728
@@ -31,7 +32,7 @@ describe('aspnet-oauth:app', () => {
3132 'AspNet.Security.OAuth.Foo/FooAuthenticationDefaults.cs' ,
3233 'AspNet.Security.OAuth.Foo/FooAuthenticationExtensions.cs' ,
3334 'AspNet.Security.OAuth.Foo/FooAuthenticationHandler.cs' ,
34- 'AspNet.Security.OAuth.Foo/FooAuthenticationOptions.cs'
35+ 'AspNet.Security.OAuth.Foo/FooAuthenticationOptions.cs' ,
3536 ] ) ;
3637 } ) ;
3738 it ( 'sets the authors name' , ( ) => {
@@ -144,7 +145,6 @@ describe('aspnet-oauth:app', () => {
144145 } ) ;
145146
146147 describe ( 'generating a new provider' , ( ) => {
147-
148148 const projectName = 'AspNet.Security.OAuth.Foo' ;
149149 const tempDir = path . join ( os . tmpdir ( ) , `_generator-aspnet-oauth-${ Math . random ( ) } ` ) ;
150150 const artifactsDir = path . join ( tempDir , 'artifacts' ) ;
@@ -156,32 +156,36 @@ describe('aspnet-oauth:app', () => {
156156 this . timeout ( 180000 ) ;
157157
158158 // 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+ ] ) ;
162164
163165 if ( clone . status !== 0 && clone . output ) {
164166 console . error ( clone . output . toString ( 'utf8' ) ) ;
165167 }
166168 assert . strictEqual ( clone . status , 0 ) ;
167169
168170 // 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 } )
170173 . cd ( sourceDir )
171174 . withOptions ( { skipInstall : true } )
172175 . withPrompts ( {
173176 name : 'Foo' ,
174177 authorname : 'John Smith' ,
175178 authorizationendpoint : 'https://foo.local/auth' ,
176179 tokenendpoint : 'https://foo.local/token' ,
177- userinformationendpoint : 'https://foo.local/user'
180+ userinformationendpoint : 'https://foo.local/user' ,
178181 } ) ;
179182
180183 // Add the new project to the solution
181184 const dotnetSlnAdd = spawnSync (
182185 `dotnet` ,
183186 [ 'sln' , 'add' , path . join ( projectDir , `${ projectName } .csproj` ) ] ,
184- { cwd : tempDir } ) ;
187+ { cwd : tempDir }
188+ ) ;
185189
186190 if ( dotnetSlnAdd . status !== 0 ) {
187191 console . error ( dotnetSlnAdd . output . toString ( 'utf8' ) ) ;
@@ -192,9 +196,14 @@ describe('aspnet-oauth:app', () => {
192196 let build ;
193197
194198 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+ } ) ;
196203 } 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+ } ) ;
198207 }
199208
200209 if ( build . status !== 0 && build . output ) {
@@ -204,15 +213,33 @@ describe('aspnet-oauth:app', () => {
204213 } ) ;
205214
206215 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+ ) ;
208224 await glob ( expected ) ;
209225 } ) ;
210226 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+ ) ;
212234 await glob ( expected ) ;
213235 } ) ;
214236 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+ ) ;
216243 await glob ( expected ) ;
217244 } ) ;
218245 } ) ;
0 commit comments