diff --git a/.appveyor.yml b/.appveyor.yml index 3e00870b5c..e749956d48 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -12,11 +12,10 @@ install: test_script: - node --version - yarn --version - - yarn test - - node tests\run_e2e.js + - node tests\run_e2e.js --appveyor build: off cache: - node_modules - - "%LOCALAPPDATA%/Yarn" \ No newline at end of file + - "%LOCALAPPDATA%/Yarn" diff --git a/tests/e2e/tests/build/base-href.ts b/tests/e2e/tests/build/base-href.ts index c8ff910a1a..1775dc3965 100644 --- a/tests/e2e/tests/build/base-href.ts +++ b/tests/e2e/tests/build/base-href.ts @@ -1,8 +1,14 @@ import {ng} from '../../utils/process'; import {expectFileToMatch} from '../../utils/fs'; +import {getGlobalVariable} from '../../utils/env'; export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return ng('build', '--base-href', '/myUrl') .then(() => expectFileToMatch('dist/index.html', //)); } diff --git a/tests/e2e/tests/build/chunk-hash.ts b/tests/e2e/tests/build/chunk-hash.ts index fab9664131..9340370ecb 100644 --- a/tests/e2e/tests/build/chunk-hash.ts +++ b/tests/e2e/tests/build/chunk-hash.ts @@ -4,6 +4,7 @@ import * as fs from 'fs'; import {ng} from '../../utils/process'; import {writeFile} from '../../utils/fs'; import {addImportToModule} from '../../utils/ast'; +import {getGlobalVariable} from '../../utils/env'; const OUTPUT_RE = /(main|polyfills|vendor|inline|styles|\d+)\.[a-z0-9]+\.(chunk|bundle)\.(js|css)$/; @@ -44,6 +45,12 @@ function validateHashes( } export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + + let oldHashes: Map; let newHashes: Map; // First, collect the hashes. diff --git a/tests/e2e/tests/build/css-urls.ts b/tests/e2e/tests/build/css-urls.ts index 571ef73369..ac86b2e3f0 100644 --- a/tests/e2e/tests/build/css-urls.ts +++ b/tests/e2e/tests/build/css-urls.ts @@ -7,6 +7,7 @@ import { writeMultipleFiles } from '../../utils/fs'; import { expectToFail } from '../../utils/utils'; +import { getGlobalVariable } from '../../utils/env'; const imgSvg = ` @@ -15,6 +16,11 @@ const imgSvg = ` `; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() // Verify absolute/relative paths in global/component css. .then(() => writeMultipleFiles({ diff --git a/tests/e2e/tests/build/delete-output-path.ts b/tests/e2e/tests/build/delete-output-path.ts index 9a5b658f8e..e503a67f6d 100644 --- a/tests/e2e/tests/build/delete-output-path.ts +++ b/tests/e2e/tests/build/delete-output-path.ts @@ -4,6 +4,11 @@ import {deleteFile, expectFileToExist} from '../../utils/fs'; import {getGlobalVariable} from '../../utils/env'; export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + // Skip this in ejected tests. if (getGlobalVariable('argv').eject) { return Promise.resolve(); diff --git a/tests/e2e/tests/build/deploy-url.ts b/tests/e2e/tests/build/deploy-url.ts index 895a4f7f9e..83d66b5ba5 100644 --- a/tests/e2e/tests/build/deploy-url.ts +++ b/tests/e2e/tests/build/deploy-url.ts @@ -1,10 +1,17 @@ import { ng } from '../../utils/process'; import { expectFileToMatch, writeMultipleFiles } from '../../utils/fs'; import { updateJsonFile } from '../../utils/project'; +import { getGlobalVariable } from '../../utils/env'; import { stripIndents } from 'common-tags'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + + return Promise.resolve() .then(() => writeMultipleFiles({ 'src/styles.css': 'div { background: url("./assets/more.svg"); }', diff --git a/tests/e2e/tests/build/filename.ts b/tests/e2e/tests/build/filename.ts index e8979648f9..2399e833a8 100644 --- a/tests/e2e/tests/build/filename.ts +++ b/tests/e2e/tests/build/filename.ts @@ -2,9 +2,15 @@ import {ng} from '../../utils/process'; import {expectFileToExist} from '../../utils/fs'; import {updateJsonFile} from '../../utils/project'; import {copyFile} from '../../utils/fs'; +import {getGlobalVariable} from '../../utils/env'; export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => copyFile('src/index.html', 'src/config-index.html')) .then(() => updateJsonFile('.angular-cli.json', configJson => { diff --git a/tests/e2e/tests/build/json.ts b/tests/e2e/tests/build/json.ts index dc116f6071..71cfa32f05 100644 --- a/tests/e2e/tests/build/json.ts +++ b/tests/e2e/tests/build/json.ts @@ -5,6 +5,11 @@ import {getGlobalVariable} from '../../utils/env'; export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + // Skip this in ejected tests. if (getGlobalVariable('argv').eject) { return Promise.resolve(); diff --git a/tests/e2e/tests/build/module-id.ts b/tests/e2e/tests/build/module-id.ts index 5fcf2d177f..581d8bbddf 100644 --- a/tests/e2e/tests/build/module-id.ts +++ b/tests/e2e/tests/build/module-id.ts @@ -1,8 +1,14 @@ import { ng } from '../../utils/process'; -import { replaceInFile } from "../../utils/fs"; +import { replaceInFile } from '../../utils/fs'; +import { getGlobalVariable } from '../../utils/env'; export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => replaceInFile('src/app/app.component.ts', '@Component({', diff --git a/tests/e2e/tests/build/no-implicit-any.ts b/tests/e2e/tests/build/no-implicit-any.ts index 08927a4146..340f7169b6 100644 --- a/tests/e2e/tests/build/no-implicit-any.ts +++ b/tests/e2e/tests/build/no-implicit-any.ts @@ -1,8 +1,14 @@ import {updateTsConfig} from '../../utils/project'; import {ng} from '../../utils/process'; +import {getGlobalVariable} from '../../utils/env'; export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return updateTsConfig(json => { json['compilerOptions']['noImplicitAny'] = true; }) diff --git a/tests/e2e/tests/build/output-hashing.ts b/tests/e2e/tests/build/output-hashing.ts index 04ad28aca7..a7c091c250 100644 --- a/tests/e2e/tests/build/output-hashing.ts +++ b/tests/e2e/tests/build/output-hashing.ts @@ -1,6 +1,7 @@ import {stripIndents} from 'common-tags'; import {ng} from '../../utils/process'; import { writeMultipleFiles, expectFileToMatch, expectFileMatchToExist } from '../../utils/fs'; +import { getGlobalVariable } from '../../utils/env'; function verifyMedia(css: RegExp, content: RegExp) { return expectFileMatchToExist('./dist', css) @@ -8,6 +9,11 @@ function verifyMedia(css: RegExp, content: RegExp) { } export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => writeMultipleFiles({ 'src/styles.css': stripIndents` diff --git a/tests/e2e/tests/build/polyfills.ts b/tests/e2e/tests/build/polyfills.ts index 2fae001ff3..a00445c348 100644 --- a/tests/e2e/tests/build/polyfills.ts +++ b/tests/e2e/tests/build/polyfills.ts @@ -1,8 +1,14 @@ import { expectFileToMatch } from '../../utils/fs'; import { ng } from '../../utils/process'; +import { getGlobalVariable } from '../../utils/env'; import { oneLineTrim } from 'common-tags'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => ng('build')) // files were created successfully diff --git a/tests/e2e/tests/build/sourcemap.ts b/tests/e2e/tests/build/sourcemap.ts index 09da904c68..9bce09b93e 100644 --- a/tests/e2e/tests/build/sourcemap.ts +++ b/tests/e2e/tests/build/sourcemap.ts @@ -1,9 +1,15 @@ import {ng} from '../../utils/process'; import {expectFileToExist} from '../../utils/fs'; import {expectToFail} from '../../utils/utils'; +import {getGlobalVariable} from '../../utils/env'; export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return ng('build') .then(() => expectFileToExist('dist/main.bundle.js.map')) diff --git a/tests/e2e/tests/build/styles/extract-css.ts b/tests/e2e/tests/build/styles/extract-css.ts index ee0c704f31..c527232932 100644 --- a/tests/e2e/tests/build/styles/extract-css.ts +++ b/tests/e2e/tests/build/styles/extract-css.ts @@ -6,9 +6,15 @@ import { import { ng } from '../../../utils/process'; import { updateJsonFile } from '../../../utils/project'; import { expectToFail } from '../../../utils/utils'; +import { getGlobalVariable } from '../../../utils/env'; import { oneLineTrim } from 'common-tags'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => writeMultipleFiles({ 'src/string-style.css': '.string-style { color: red }', diff --git a/tests/e2e/tests/build/styles/postcss.ts b/tests/e2e/tests/build/styles/postcss.ts index 14636a95c7..08600f69d6 100644 --- a/tests/e2e/tests/build/styles/postcss.ts +++ b/tests/e2e/tests/build/styles/postcss.ts @@ -1,9 +1,15 @@ import * as glob from 'glob'; import { writeFile, expectFileToMatch } from '../../../utils/fs'; import { ng } from '../../../utils/process'; +import { getGlobalVariable } from '../../../utils/env'; import { stripIndents } from 'common-tags'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return writeFile('src/styles.css', stripIndents` /* normal-comment */ /*! important-comment */ diff --git a/tests/e2e/tests/commands/new/new-routing.ts b/tests/e2e/tests/commands/new/new-routing.ts index 1726abad6c..953aa16190 100644 --- a/tests/e2e/tests/commands/new/new-routing.ts +++ b/tests/e2e/tests/commands/new/new-routing.ts @@ -1,8 +1,14 @@ import {ng} from '../../../utils/process'; import {createProject} from '../../../utils/project'; +import { getGlobalVariable } from '../../../utils/env'; export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => createProject('routing-project', '--routing')) diff --git a/tests/e2e/tests/commands/new/new-skip-commit.ts b/tests/e2e/tests/commands/new/new-skip-commit.ts index 95a4328f21..c57e34b67f 100644 --- a/tests/e2e/tests/commands/new/new-skip-commit.ts +++ b/tests/e2e/tests/commands/new/new-skip-commit.ts @@ -2,9 +2,15 @@ import {ng} from '../../../utils/process'; import {createProject} from '../../../utils/project'; import {expectToFail} from '../../../utils/utils'; import {expectGitToBeClean} from '../../../utils/git'; +import {getGlobalVariable} from '../../../utils/env'; export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => createProject('new-project', '--skip-commit')) .then(() => expectToFail(() => expectGitToBeClean())) diff --git a/tests/e2e/tests/commands/new/new-skip-tests.ts b/tests/e2e/tests/commands/new/new-skip-tests.ts index 95dde0a38e..62c5328b85 100644 --- a/tests/e2e/tests/commands/new/new-skip-tests.ts +++ b/tests/e2e/tests/commands/new/new-skip-tests.ts @@ -1,8 +1,14 @@ import {createProject} from '../../../utils/project'; import {expectFileNotToExist} from '../../../utils/fs'; +import {getGlobalVariable} from '../../../utils/env'; export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => createProject('new-project-skip-tests', '--skip-tests')) .then(() => expectFileNotToExist('src/app/app.component.spec.ts')); diff --git a/tests/e2e/tests/lint/lint-no-config-section.ts b/tests/e2e/tests/lint/lint-no-config-section.ts index d2bfc1e499..79378681ca 100644 --- a/tests/e2e/tests/lint/lint-no-config-section.ts +++ b/tests/e2e/tests/lint/lint-no-config-section.ts @@ -1,7 +1,13 @@ import { ng } from '../../utils/process'; +import { getGlobalVariable } from '../../utils/env'; import { oneLine } from 'common-tags'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => ng('set', 'lint', '[]')) .then(() => ng('lint')) diff --git a/tests/e2e/tests/lint/lint-no-project.ts b/tests/e2e/tests/lint/lint-no-project.ts index d558a76c8d..9e374ef040 100644 --- a/tests/e2e/tests/lint/lint-no-project.ts +++ b/tests/e2e/tests/lint/lint-no-project.ts @@ -1,9 +1,15 @@ import { ng } from '../../utils/process'; import { writeFile } from '../../utils/fs'; import { expectToFail } from '../../utils/utils'; +import { getGlobalVariable } from '../../utils/env'; import { oneLine } from 'common-tags'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => ng('set', 'lint.0.project', '')) .then(() => ng('lint', '--type-check')) diff --git a/tests/e2e/tests/lint/lint-with-exclude.ts b/tests/e2e/tests/lint/lint-with-exclude.ts index bcf193acc6..be792e2e95 100644 --- a/tests/e2e/tests/lint/lint-with-exclude.ts +++ b/tests/e2e/tests/lint/lint-with-exclude.ts @@ -1,8 +1,14 @@ import { ng } from '../../utils/process'; import { writeFile } from '../../utils/fs'; +import { getGlobalVariable } from '../../utils/env'; import { oneLine } from 'common-tags'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + const fileName = 'src/app/foo.ts'; return Promise.resolve() diff --git a/tests/e2e/tests/lint/lint-with-force.ts b/tests/e2e/tests/lint/lint-with-force.ts index 1f40b16a23..ac3f2975e6 100644 --- a/tests/e2e/tests/lint/lint-with-force.ts +++ b/tests/e2e/tests/lint/lint-with-force.ts @@ -1,8 +1,14 @@ import { ng } from '../../utils/process'; import { writeFile } from '../../utils/fs'; +import { getGlobalVariable } from '../../utils/env'; import { oneLine } from 'common-tags'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + const fileName = 'src/app/foo.ts'; return Promise.resolve() diff --git a/tests/e2e/tests/lint/lint-with-format.ts b/tests/e2e/tests/lint/lint-with-format.ts index 50ee8b5454..ed21f1ae87 100644 --- a/tests/e2e/tests/lint/lint-with-format.ts +++ b/tests/e2e/tests/lint/lint-with-format.ts @@ -1,8 +1,14 @@ import { ng } from '../../utils/process'; import { writeFile } from '../../utils/fs'; +import { getGlobalVariable } from '../../utils/env'; import { oneLine } from 'common-tags'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + const fileName = 'src/app/foo.ts'; return Promise.resolve() diff --git a/tests/e2e/tests/lint/lint-with-nested-configs.ts b/tests/e2e/tests/lint/lint-with-nested-configs.ts index 244cd82922..d0580fa8f1 100644 --- a/tests/e2e/tests/lint/lint-with-nested-configs.ts +++ b/tests/e2e/tests/lint/lint-with-nested-configs.ts @@ -1,8 +1,14 @@ import { createDir, writeFile } from '../../utils/fs'; import { ng } from '../../utils/process'; import { expectToFail } from '../../utils/utils'; +import { getGlobalVariable } from '../../utils/env'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + const fileName = 'src/app/foo/foo.ts'; const nestedConfigContent = ` { diff --git a/tests/e2e/tests/lint/lint-with-type-check-fail.ts b/tests/e2e/tests/lint/lint-with-type-check-fail.ts index 70c79433a5..ce8437d018 100644 --- a/tests/e2e/tests/lint/lint-with-type-check-fail.ts +++ b/tests/e2e/tests/lint/lint-with-type-check-fail.ts @@ -1,8 +1,14 @@ import { ng } from '../../utils/process'; import { expectToFail } from '../../utils/utils'; import { writeFile } from '../../utils/fs'; +import { getGlobalVariable } from '../../utils/env'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + const fileName = 'src/app/foo.ts'; const fileContents = ` const ANIMATION_CSS_VALUE_REGEX = 'asda'; diff --git a/tests/e2e/tests/lint/lint-with-type-check.ts b/tests/e2e/tests/lint/lint-with-type-check.ts index 7e020a5228..59b8642cf6 100644 --- a/tests/e2e/tests/lint/lint-with-type-check.ts +++ b/tests/e2e/tests/lint/lint-with-type-check.ts @@ -1,7 +1,13 @@ import { ng } from '../../utils/process'; import { writeFile } from '../../utils/fs'; +import { getGlobalVariable } from '../../utils/env'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + const fileName = 'src/app/foo.ts'; const fileContents = ` const ANIMATION_CSS_VALUE_REGEX = 'asda'; diff --git a/tests/e2e/tests/misc/coverage.ts b/tests/e2e/tests/misc/coverage.ts index f7e008b550..280a5cca84 100644 --- a/tests/e2e/tests/misc/coverage.ts +++ b/tests/e2e/tests/misc/coverage.ts @@ -2,9 +2,15 @@ import {expectFileToExist, expectFileToMatch} from '../../utils/fs'; import {updateJsonFile} from '../../utils/project'; import {expectToFail} from '../../utils/utils'; import {ng} from '../../utils/process'; +import {getGlobalVariable} from '../../utils/env'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return ng('test', '--single-run', '--code-coverage') .then(() => expectFileToExist('coverage/src/app')) .then(() => expectFileToExist('coverage/lcov.info')) diff --git a/tests/e2e/tests/misc/default-port.ts b/tests/e2e/tests/misc/default-port.ts index 8ab525c455..a010173f29 100644 --- a/tests/e2e/tests/misc/default-port.ts +++ b/tests/e2e/tests/misc/default-port.ts @@ -2,8 +2,14 @@ import { request } from '../../utils/http'; import { killAllProcesses } from '../../utils/process'; import { ngServe } from '../../utils/project'; import { updateJsonFile } from '../../utils/project'; +import { getGlobalVariable } from '../../utils/env'; export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson.defaults; diff --git a/tests/e2e/tests/misc/deploy-url.ts b/tests/e2e/tests/misc/deploy-url.ts index adb32fef9a..ed3d28c48f 100644 --- a/tests/e2e/tests/misc/deploy-url.ts +++ b/tests/e2e/tests/misc/deploy-url.ts @@ -1,8 +1,14 @@ import { killAllProcesses } from '../../utils/process'; import { request } from '../../utils/http'; import { ngServe } from '../../utils/project'; +import { getGlobalVariable } from '../../utils/env'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() // check when setup through command line arguments .then(() => ngServe('--deploy-url', '/deployurl/', '--base-href', '/deployurl/')) diff --git a/tests/e2e/tests/misc/different-file-format.ts b/tests/e2e/tests/misc/different-file-format.ts index 9f1abbb7ea..df2fe4ff42 100644 --- a/tests/e2e/tests/misc/different-file-format.ts +++ b/tests/e2e/tests/misc/different-file-format.ts @@ -1,5 +1,6 @@ import {ng} from '../../utils/process'; import * as fs from '../../utils/fs'; +import {getGlobalVariable} from '../../utils/env'; const options = { @@ -8,6 +9,11 @@ const options = { export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => fs.prependToFile('./src/tsconfig.app.json', '\ufeff', options)) .then(() => fs.prependToFile('./.angular-cli.json', '\ufeff', options)) diff --git a/tests/e2e/tests/misc/fallback.ts b/tests/e2e/tests/misc/fallback.ts index 6c3cefe868..c3cf7067aa 100644 --- a/tests/e2e/tests/misc/fallback.ts +++ b/tests/e2e/tests/misc/fallback.ts @@ -3,9 +3,15 @@ import { killAllProcesses } from '../../utils/process'; import { ngServe } from '../../utils/project'; import { updateJsonFile } from '../../utils/project'; import { moveFile } from '../../utils/fs'; +import { getGlobalVariable } from '../../utils/env'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + // should fallback to config.app[0].index (index.html by default) return Promise.resolve() .then(() => ngServe()) diff --git a/tests/e2e/tests/misc/ssl-default-config.ts b/tests/e2e/tests/misc/ssl-default-config.ts index 6dc287a1dd..c87641a54d 100644 --- a/tests/e2e/tests/misc/ssl-default-config.ts +++ b/tests/e2e/tests/misc/ssl-default-config.ts @@ -2,13 +2,19 @@ import { request } from '../../utils/http'; import { killAllProcesses } from '../../utils/process'; import { ngServe } from '../../utils/project'; import { updateJsonFile } from '../../utils/project'; +import { getGlobalVariable } from '../../utils/env'; export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson.defaults; app.serve = { ssl: true }; - })) + })) .then(() => ngServe()) .then(() => request('https://localhost:4200/')) .then(body => { diff --git a/tests/e2e/tests/misc/ssl-default.ts b/tests/e2e/tests/misc/ssl-default.ts index 80c3952b16..5f32001067 100644 --- a/tests/e2e/tests/misc/ssl-default.ts +++ b/tests/e2e/tests/misc/ssl-default.ts @@ -1,9 +1,15 @@ import { request } from '../../utils/http'; import { killAllProcesses } from '../../utils/process'; import { ngServe } from '../../utils/project'; +import { getGlobalVariable } from '../../utils/env'; export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => ngServe('--ssl', 'true')) .then(() => request('https://localhost:4200/')) diff --git a/tests/e2e/tests/misc/ssl-with-cert-config.ts b/tests/e2e/tests/misc/ssl-with-cert-config.ts index 605c987269..50e03f2485 100644 --- a/tests/e2e/tests/misc/ssl-with-cert-config.ts +++ b/tests/e2e/tests/misc/ssl-with-cert-config.ts @@ -3,8 +3,14 @@ import { assetDir } from '../../utils/assets'; import { killAllProcesses } from '../../utils/process'; import { ngServe } from '../../utils/project'; import { updateJsonFile } from '../../utils/project'; +import { getGlobalVariable } from '../../utils/env'; export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => updateJsonFile('.angular-cli.json', configJson => { const app = configJson.defaults; @@ -13,7 +19,7 @@ export default function() { sslKey: assetDir('ssl/server.key'), sslCert: assetDir('ssl/server.crt') }; - })) + })) .then(() => ngServe()) .then(() => request('https://localhost:4200/')) .then(body => { diff --git a/tests/e2e/tests/misc/ssl-with-cert.ts b/tests/e2e/tests/misc/ssl-with-cert.ts index e15aaed9d2..de2e0c90ca 100644 --- a/tests/e2e/tests/misc/ssl-with-cert.ts +++ b/tests/e2e/tests/misc/ssl-with-cert.ts @@ -2,9 +2,15 @@ import { request } from '../../utils/http'; import { assetDir } from '../../utils/assets'; import { killAllProcesses } from '../../utils/process'; import { ngServe } from '../../utils/project'; +import { getGlobalVariable } from '../../utils/env'; export default function() { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => ngServe( '--ssl', 'true', diff --git a/tests/e2e/tests/test/e2e-baseurl.ts b/tests/e2e/tests/test/e2e-baseurl.ts index f7d0f32f91..8a70d4ef61 100644 --- a/tests/e2e/tests/test/e2e-baseurl.ts +++ b/tests/e2e/tests/test/e2e-baseurl.ts @@ -2,8 +2,14 @@ import { ng, killAllProcesses } from '../../utils/process'; import { expectToFail } from '../../utils/utils'; import { ngServe } from '../../utils/project'; import { updateJsonFile } from '../../utils/project'; +import { getGlobalVariable } from '../../utils/env'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => expectToFail(() => ng('e2e', '--no-serve'))) .then(() => updateJsonFile('.angular-cli.json', configJson => { diff --git a/tests/e2e/tests/test/test-assets.ts b/tests/e2e/tests/test/test-assets.ts index 12d247aad6..adf3ee2732 100644 --- a/tests/e2e/tests/test/test-assets.ts +++ b/tests/e2e/tests/test/test-assets.ts @@ -2,10 +2,16 @@ import { writeMultipleFiles } from '../../utils/fs'; import { ng } from '../../utils/process'; import { updateJsonFile } from '../../utils/project'; import { expectToFail } from '../../utils/utils'; +import { getGlobalVariable } from '../../utils/env'; import { stripIndent } from 'common-tags'; // Make sure asset files are served export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => writeMultipleFiles({ 'src/assets/file.txt': 'assets-folder-content', diff --git a/tests/e2e/tests/test/test-backwards-compat.ts b/tests/e2e/tests/test/test-backwards-compat.ts index 3cd2ecc0cf..067f19b9c3 100644 --- a/tests/e2e/tests/test/test-backwards-compat.ts +++ b/tests/e2e/tests/test/test-backwards-compat.ts @@ -1,7 +1,13 @@ import { ng } from '../../utils/process'; import { replaceInFile } from '../../utils/fs'; +import { getGlobalVariable } from '../../utils/env'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + // Old configs (with the cli preprocessor listed) should still supported. return Promise.resolve() .then(() => replaceInFile('karma.conf.js', diff --git a/tests/e2e/tests/test/test-scripts.ts b/tests/e2e/tests/test/test-scripts.ts index f3ee3993f0..4ca07efd65 100644 --- a/tests/e2e/tests/test/test-scripts.ts +++ b/tests/e2e/tests/test/test-scripts.ts @@ -2,9 +2,15 @@ import { writeMultipleFiles } from '../../utils/fs'; import { ng } from '../../utils/process'; import { updateJsonFile } from '../../utils/project'; import { expectToFail } from '../../utils/utils'; +import { getGlobalVariable } from '../../utils/env'; import { stripIndent } from 'common-tags'; export default function () { + // Skip this in Appveyor tests. + if (getGlobalVariable('argv').appveyor) { + return Promise.resolve(); + } + return Promise.resolve() .then(() => ng('test', '--watch=false')) // prepare global scripts test files @@ -30,8 +36,8 @@ export default function () { describe('AppComponent', () => { beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ AppComponent ] + TestBed.configureTestingModule({ + declarations: [ AppComponent ] }).compileComponents(); })); diff --git a/tests/e2e_runner.ts b/tests/e2e_runner.ts index 5e9bb14d2e..7fa9ff8444 100644 --- a/tests/e2e_runner.ts +++ b/tests/e2e_runner.ts @@ -39,7 +39,7 @@ Error.stackTraceLimit = Infinity; * If unnamed flags are passed in, the list of tests will be filtered to include only those passed. */ const argv = minimist(process.argv.slice(2), { - 'boolean': ['debug', 'nolink', 'nightly', 'noproject', 'verbose', 'eject'], + 'boolean': ['debug', 'nolink', 'nightly', 'noproject', 'verbose', 'eject', 'appveyor'], 'string': ['glob', 'ignore', 'reuse', 'ng-sha', ] });