Skip to content

Commit 8f904aa

Browse files
committed
test: update CI chrome for single project structure
1 parent ac2ef6d commit 8f904aa

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

tests/e2e/setup/500-create-project.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ export default async function() {
3333
return Promise.resolve()
3434
.then(() => useBuiltPackages())
3535
.then(() => argv.devkit && useDevKit(argv.devkit))
36-
.then(() => useCIChrome())
36+
.then(() => useCIChrome('e2e'))
37+
.then(() => useCIChrome('src'))
3738
.then(() => useCIDefaults())
3839
.then(() => argv['ng-version'] ? useNgVersion(argv['ng-version']) : Promise.resolve())
3940
.then(() => argv.nightly || argv['ng-sha'] ? useSha() : Promise.resolve())

tests/e2e/tests/generate/application/application-basic.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { useCIChrome } from '../../../utils/project';
66
export default function() {
77
return ng('generate', 'application', 'app2')
88
.then(() => expectFileToMatch('angular.json', /\"app2\":/))
9-
.then(() => useCIChrome('app2'))
9+
.then(() => useCIChrome('projects/app2'))
10+
.then(() => useCIChrome('projects/app2-e2e'))
1011
.then(() => ng('test', 'app2', '--watch=false'));
1112
}

tests/e2e/tests/generate/library/library-basic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useCIChrome } from '../../../utils/project';
55
export default function () {
66
return ng('generate', 'library', 'my-lib')
77
.then(() => expectFileToMatch('angular.json', /\"my-lib\":/))
8-
.then(() => useCIChrome('my-lib'))
8+
.then(() => useCIChrome('projects/my-lib'))
99
.then(() => silentNpm('install'))
1010
.then(() => ng('build', 'my-lib'))
1111
.then(() => ng('test', 'my-lib', '--watch=false'));

tests/e2e/utils/project.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ export function createProject(name: string, ...args: string[]) {
3939
.then(() => ng('new', name, '--skip-install', ...args))
4040
.then(() => process.chdir(name))
4141
.then(() => useBuiltPackages())
42-
.then(() => useCIChrome())
42+
.then(() => useCIChrome('e2e'))
43+
.then(() => useCIChrome('src'))
4344
.then(() => useCIDefaults())
4445
.then(() => argv['ng2'] ? useNg2() : Promise.resolve())
4546
.then(() => argv['ng4'] ? useNg4() : Promise.resolve())
@@ -169,13 +170,13 @@ export function useCIDefaults() {
169170
});
170171
}
171172

172-
export function useCIChrome(projectDir = 'test-project') {
173+
export function useCIChrome(projectDir: string) {
173174
// There's a race condition happening in Chrome. Enabling logging in chrome used by
174175
// protractor actually fixes it. Logging is piped to a file so it doesn't affect our setup.
175176
// --no-sandbox is needed for Circle CI.
176177
// Travis can use headless chrome, but not appveyor.
177178
return Promise.resolve()
178-
.then(() => replaceInFile(`projects/${projectDir}-e2e/protractor.conf.js`,
179+
.then(() => replaceInFile(`${projectDir}/protractor.conf.js`,
179180
`'browserName': 'chrome'`,
180181
`'browserName': 'chrome',
181182
chromeOptions: {
@@ -188,7 +189,7 @@ export function useCIChrome(projectDir = 'test-project') {
188189
`))
189190
// Not a problem if the file can't be found.
190191
.catch(() => null)
191-
.then(() => replaceInFile(`projects/${projectDir}/karma.conf.js`, `browsers: ['Chrome'],`,
192+
.then(() => replaceInFile(`${projectDir}/karma.conf.js`, `browsers: ['Chrome'],`,
192193
`browsers: ['ChromeCI'],
193194
customLaunchers: {
194195
ChromeCI: {

0 commit comments

Comments
 (0)