Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

build: update testing configuration #793

Merged
merged 1 commit into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/saucelabs/start-tunnel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e -o pipefail

TUNNEL_FILE="sc-4.4.9-linux.tar.gz"
TUNNEL_FILE="sc-4.4.12-linux.tar.gz"
TUNNEL_URL="https://saucelabs.com/downloads/${TUNNEL_FILE}"
TUNNEL_DIR="/tmp/saucelabs-connect"

Expand Down
65 changes: 65 additions & 0 deletions test/karma-system-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Configure the base path and map the different node packages.
System.config({
baseURL: '/base',
paths: {
'node:*': 'node_modules/*'
},
map: {
'rxjs': 'node:rxjs',
'tslib': 'node:tslib/tslib.js',

// Angular specific mappings.
'@angular/core': 'node:@angular/core/bundles/core.umd.js',
'@angular/core/testing': 'node:@angular/core/bundles/core-testing.umd.js',
'@angular/common': 'node:@angular/common/bundles/common.umd.js',
'@angular/common/testing': 'node:@angular/common/bundles/common-testing.umd.js',
'@angular/common/http': 'node:@angular/common/bundles/common-http.umd.js',
'@angular/common/http/testing': 'node:@angular/common/bundles/common-http-testing.umd.js',
'@angular/compiler': 'node:@angular/compiler/bundles/compiler.umd.js',
'@angular/compiler/testing': 'node:@angular/compiler/bundles/compiler-testing.umd.js',
'@angular/http': 'node:@angular/http/bundles/http.umd.js',
'@angular/http/testing': 'node:@angular/http/bundles/http-testing.umd.js',
'@angular/forms': 'node:@angular/forms/bundles/forms.umd.js',
'@angular/forms/testing': 'node:@angular/forms/bundles/forms-testing.umd.js',
'@angular/animations': 'node:@angular/animations/bundles/animations.umd.js',
'@angular/animations/browser': 'node:@angular/animations/bundles/animations-browser.umd.js',
'@angular/platform-browser/animations':
'node:@angular/platform-browser/bundles/platform-browser-animations.umd',
'@angular/platform-browser':
'node:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser/testing':
'node:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
'@angular/platform-browser-dynamic':
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/platform-browser-dynamic/testing':
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',

'@angular/material/button': 'node:@angular/material/bundles/material-button.umd.js',
'@angular/material/core': 'node:@angular/material/bundles/material-core.umd.js',
'@angular/cdk': 'node:@angular/cdk/bundles/cdk.umd.js',
'@angular/cdk/a11y': 'node:@angular/cdk/bundles/cdk-a11y.umd.js',
'@angular/cdk/bidi': 'node:@angular/cdk/bundles/cdk-bidi.umd.js',
'@angular/cdk/coercion': 'node:@angular/cdk/bundles/cdk-coercion.umd.js',
'@angular/cdk/keycodes': 'node:@angular/cdk/bundles/cdk-keycodes.umd.js',
'@angular/cdk/platform': 'node:@angular/cdk/bundles/cdk-platform.umd.js',

// Path mappings for local packages that can be imported inside of tests.
'@angular/flex-layout': 'dist/packages/flex-layout/index.js',
'@angular/flex-layout/core': 'dist/packages/flex-layout/core/index.js',
'@angular/flex-layout/extended': 'dist/packages/flex-layout/extended/index.js',
'@angular/flex-layout/flex': 'dist/packages/flex-layout/flex/index.js',
'@angular/flex-layout/grid': 'dist/packages/flex-layout/grid/index.js',
'@angular/flex-layout/server': 'dist/packages/flex-layout/server/index.js',
},
packages: {
// Thirdparty barrels.
'rxjs': {main: 'index'},
'rxjs/operators': {main: 'index'},

// Set the default extension for the root package, because otherwise the demo-app can't
// be built within the production mode. Due to missing file extensions.
'.': {
defaultExtension: 'js'
}
}
});
68 changes: 1 addition & 67 deletions test/karma-test-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,75 +9,9 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;

__karma__.loaded = function () {};

var baseDir = '/base';
var specFiles = Object.keys(window.__karma__.files).filter(isSpecFile);

// Configure the base path and map the different node packages.
System.config({
baseURL: baseDir,
paths: {
'node:*': 'node_modules/*'
},
map: {
'rxjs': 'node:rxjs',
'main': 'main.js',
'tslib': 'node:tslib/tslib.js',

// Angular specific mappings.
'@angular/core': 'node:@angular/core/bundles/core.umd.js',
'@angular/core/testing': 'node:@angular/core/bundles/core-testing.umd.js',
'@angular/common': 'node:@angular/common/bundles/common.umd.js',
'@angular/common/testing': 'node:@angular/common/bundles/common-testing.umd.js',
'@angular/common/http': 'node:@angular/common/bundles/common-http.umd.js',
'@angular/common/http/testing': 'node:@angular/common/bundles/common-http-testing.umd.js',
'@angular/compiler': 'node:@angular/compiler/bundles/compiler.umd.js',
'@angular/compiler/testing': 'node:@angular/compiler/bundles/compiler-testing.umd.js',
'@angular/http': 'node:@angular/http/bundles/http.umd.js',
'@angular/http/testing': 'node:@angular/http/bundles/http-testing.umd.js',
'@angular/forms': 'node:@angular/forms/bundles/forms.umd.js',
'@angular/forms/testing': 'node:@angular/forms/bundles/forms-testing.umd.js',
'@angular/animations': 'node:@angular/animations/bundles/animations.umd.js',
'@angular/animations/browser': 'node:@angular/animations/bundles/animations-browser.umd.js',
'@angular/platform-browser/animations':
'node:@angular/platform-browser/bundles/platform-browser-animations.umd',
'@angular/platform-browser':
'node:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser/testing':
'node:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
'@angular/platform-browser-dynamic':
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/platform-browser-dynamic/testing':
'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',

'@angular/material/button': 'node:@angular/material/bundles/material-button.umd.js',
'@angular/material/core': 'node:@angular/material/bundles/material-core.umd.js',
'@angular/cdk': 'node:@angular/cdk/bundles/cdk.umd.js',
'@angular/cdk/a11y': 'node:@angular/cdk/bundles/cdk-a11y.umd.js',
'@angular/cdk/bidi': 'node:@angular/cdk/bundles/cdk-bidi.umd.js',
'@angular/cdk/coercion': 'node:@angular/cdk/bundles/cdk-coercion.umd.js',
'@angular/cdk/keycodes': 'node:@angular/cdk/bundles/cdk-keycodes.umd.js',
'@angular/cdk/platform': 'node:@angular/cdk/bundles/cdk-platform.umd.js',

// Path mappings for local packages that can be imported inside of tests.
'@angular/flex-layout': 'dist/packages/flex-layout/index.js',
'@angular/flex-layout/core': 'dist/packages/flex-layout/core/index.js',
'@angular/flex-layout/extended': 'dist/packages/flex-layout/extended/index.js',
'@angular/flex-layout/flex': 'dist/packages/flex-layout/flex/index.js',
'@angular/flex-layout/grid': 'dist/packages/flex-layout/grid/index.js',
'@angular/flex-layout/server': 'dist/packages/flex-layout/server/index.js',
},
packages: {
// Thirdparty barrels.
'rxjs': {main: 'index'},
'rxjs/operators': {main: 'index'},

// Set the default extension for the root package, because otherwise the demo-app can't
// be built within the production mode. Due to missing file extensions.
'.': {
defaultExtension: 'js'
}
}
});


// Configure the Angular test bed and run all specs once configured.
configureTestBed()
Expand Down
17 changes: 7 additions & 10 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ module.exports = (config) => {
require('karma-coverage'),
],
files: [
{pattern: 'node_modules/core-js/client/core.js', included: true, watched: false},
{pattern: 'node_modules/core-js/client/core.min.js', included: true, watched: false},
{pattern: 'node_modules/tslib/tslib.js', included: true, watched: false},
{pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: false},
{pattern: 'node_modules/zone.js/dist/zone.js', included: true, watched: false},
{pattern: 'node_modules/zone.js/dist/proxy.js', included: true, watched: false},
{pattern: 'node_modules/systemjs/dist/system.js', included: true, watched: false},
{pattern: 'node_modules/zone.js/dist/zone.min.js', included: true, watched: false},
{pattern: 'node_modules/zone.js/dist/proxy.min.js', included: true, watched: false},
{pattern: 'node_modules/zone.js/dist/sync-test.js', included: true, watched: false},
{pattern: 'node_modules/zone.js/dist/jasmine-patch.js', included: true, watched: false},
{pattern: 'node_modules/zone.js/dist/jasmine-patch.min.js', included: true, watched: false},
{pattern: 'node_modules/zone.js/dist/async-test.js', included: true, watched: false},
{pattern: 'node_modules/zone.js/dist/fake-async-test.js', included: true, watched: false},

{pattern: 'node_modules/@angular/**/*', included: false, watched: false},
{pattern: 'node_modules/rxjs/**/*', included: false, watched: false},

{pattern: 'test/karma-system-config.js', included: true, watched: false},
{pattern: 'test/karma-test-shim.js', included: true, watched: false},


Expand All @@ -53,12 +54,8 @@ module.exports = (config) => {
subdir: '.'
},

specReporter: {
maxLogLines: 1,
},

sauceLabs: {
testName: 'flex-layout',
testName: 'Angular Layout Unit Tests',
startConnect: false,
recordVideo: false,
recordScreenshots: false,
Expand Down
1 change: 0 additions & 1 deletion test/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const fs = require('fs');
const path = require('path');

// Load ts-node to be able to execute TypeScript files with protractor.
Expand Down