This repository has been archived by the owner on Dec 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
92a777c
commit e576df4
Showing
5 changed files
with
137 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,59 @@ | ||
/*jshint jasmine: true, node: true */ | ||
'use strict'; | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const common = require('./shared/common'); | ||
const tests = require('./shared/tests'); | ||
|
||
describe('skyux build jit', () => { | ||
function prepareBuild() { | ||
const opts = { mode: 'easy', name: 'dist', compileMode: 'jit' }; | ||
return common.prepareBuild(opts) | ||
.catch(err => console.error); | ||
} | ||
|
||
beforeAll((done) => { | ||
const opts = { mode: 'easy', name: 'dist', compileMode: 'jit' }; | ||
common.prepareBuild(opts) | ||
.then(done) | ||
.catch(err => { | ||
console.log(err); | ||
done(); | ||
}); | ||
}); | ||
describe('skyux build jit', () => { | ||
describe('w/base template', () => { | ||
beforeAll((done) => prepareBuild().then(done)); | ||
|
||
afterAll(common.afterAll); | ||
it('should have exitCode 0', tests.verifyExitCode); | ||
|
||
it('should have exitCode 0', tests.verifyExitCode); | ||
it('should generate expected static files', tests.verifyFiles); | ||
|
||
it('should generate expected static files', tests.verifyFiles); | ||
it('should render the home components', tests.renderHomeComponent); | ||
|
||
it('should render the home components', tests.renderHomeComponent); | ||
it('should render shared nav component', tests.renderSharedNavComponent); | ||
|
||
it('should render shared nav component', tests.renderSharedNavComponent); | ||
it('should follow routerLink and render about component', tests.followRouterLinkRenderAbout); | ||
|
||
it('should follow routerLink and render about component', tests.followRouterLinkRenderAbout); | ||
afterAll(common.afterAll); | ||
}); | ||
|
||
describe('w/guard', () => { | ||
beforeAll((done) => { | ||
const guard = ` | ||
import { Injectable } from '@angular/core'; | ||
@Injectable() | ||
export class AboutGuard { | ||
canActivate(next: any, state: any) { | ||
return false; | ||
} | ||
} | ||
`; | ||
|
||
common.writeAppFile('about/index.guard.ts', guard) | ||
.then(() => prepareBuild()) | ||
.then(done) | ||
.catch(console.error); | ||
}); | ||
|
||
it('should not follow routerLink when guard returns false', tests.respectGuardCanActivate); | ||
|
||
afterAll((done) => { | ||
common.removeAppFile('about/index.guard.ts') | ||
.then(() => common.afterAll()) | ||
.then(done) | ||
.catch(console.error); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters