feat(package): upgrade to ng v2.3+ (#574)
This commit was merged in pull request #574.
This commit is contained in:
committed by
GitHub
parent
f5b5dc3bd2
commit
3cc6a9946f
1
scripts/.gitignore
vendored
Normal file
1
scripts/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!**/*.js
|
||||
21
scripts/matchers.ts
Normal file
21
scripts/matchers.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
// tslint:disable
|
||||
/**
|
||||
* @copyright Angular ng-bootstrap team
|
||||
*/
|
||||
beforeEach(() => {
|
||||
jasmine.addMatchers({
|
||||
toHaveCssClass(/*util, customEqualityTests*/) {
|
||||
return {compare: buildError(false), negativeCompare: buildError(true)};
|
||||
|
||||
function buildError(isNot) {
|
||||
return function (actual, className) {
|
||||
const orNot = isNot ? 'not ' : '';
|
||||
return {
|
||||
pass: actual.classList.contains(className) === !isNot,
|
||||
message: `Expected ${actual.outerHTML} ${orNot} to contain the CSS class "${className}"`
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
18
scripts/sauce-browsers.js
Normal file
18
scripts/sauce-browsers.js
Normal file
@@ -0,0 +1,18 @@
|
||||
module.exports.customLaunchers = function customLaunchers() {
|
||||
return {
|
||||
sl_chrome: {base: 'SauceLabs', browserName: 'chrome'},
|
||||
sl_chrome_1: {base: 'SauceLabs', browserName: 'chrome', version: 'latest-1'},
|
||||
sl_firefox: {base: 'SauceLabs', browserName: 'firefox'},
|
||||
sl_firefox_1: {base: 'SauceLabs', browserName: 'firefox', version: 'latest-1'},
|
||||
sl_ie9: {base: 'SauceLabs', browserName: 'internet explorer', platform: 'Windows 2008', version: '9'},
|
||||
'SL_IE10': {base: 'SauceLabs', browserName: 'internet explorer', platform: 'Windows 2012', version: '10'},
|
||||
'SL_IE11': {base: 'SauceLabs', browserName: 'internet explorer', platform: 'Windows 8.1', version: '11'},
|
||||
'SL_EDGE': {base: 'SauceLabs', browserName: 'MicrosoftEdge', platform: 'Windows 10', version: '13.10586'},
|
||||
'SL_IOS9': {base: 'SauceLabs', browserName: 'iphone', platform: 'OS X 10.10', version: '9.3'},
|
||||
'SL_IOS10': {base: 'SauceLabs', browserName: 'iphone', platform: 'OS X 10.10', version: '10.0'},
|
||||
'SL_ANDROID4.4': {base: 'SauceLabs', browserName: 'android', platform: 'Linux', version: '4.4'},
|
||||
'SL_ANDROID5': {base: 'SauceLabs', browserName: 'android', platform: 'Linux', version: '5.1'},
|
||||
'SL_SAFARI9': {base: 'SauceLabs', browserName: 'safari', platform: 'OS X 10.11', version: '9.0'}
|
||||
};
|
||||
};
|
||||
|
||||
37
scripts/test.ts
Normal file
37
scripts/test.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import '../demo/src/polyfills.ts';
|
||||
|
||||
import 'zone.js/dist/long-stack-trace-zone';
|
||||
import 'zone.js/dist/proxy.js';
|
||||
import 'zone.js/dist/sync-test';
|
||||
import 'zone.js/dist/jasmine-patch';
|
||||
import 'zone.js/dist/async-test';
|
||||
import 'zone.js/dist/fake-async-test';
|
||||
import { getTestBed } from '@angular/core/testing';
|
||||
import {
|
||||
BrowserDynamicTestingModule,
|
||||
platformBrowserDynamicTesting
|
||||
} from '@angular/platform-browser-dynamic/testing';
|
||||
|
||||
import './matchers';
|
||||
|
||||
// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
|
||||
declare var __karma__: any;
|
||||
declare var require: any;
|
||||
|
||||
// Prevent Karma from running prematurely.
|
||||
__karma__.loaded = Function.prototype;
|
||||
|
||||
// First, initialize the Angular testing environment.
|
||||
getTestBed().initTestEnvironment(
|
||||
BrowserDynamicTestingModule,
|
||||
platformBrowserDynamicTesting()
|
||||
);
|
||||
// Then we find all the tests.
|
||||
let context = require.context('../demo/src', true, /\.spec\.ts/);
|
||||
// And load the modules.
|
||||
context.keys().map(context);
|
||||
|
||||
let context2 = require.context('../src/spec', true, /\.spec\.ts/);
|
||||
context2.keys().map(context2);
|
||||
// Finally, start Karma to run the tests.
|
||||
__karma__.start();
|
||||
17
scripts/typings.d.ts
vendored
Normal file
17
scripts/typings.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Typings reference file, you can add your own global typings here
|
||||
// https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html
|
||||
|
||||
// tslint:disable
|
||||
|
||||
declare const System: any;
|
||||
declare const ENV:string;
|
||||
// google code-prettify
|
||||
declare const PR:any;
|
||||
|
||||
declare const global:any;
|
||||
|
||||
declare module jasmine {
|
||||
interface Matchers {
|
||||
toHaveCssClass(expected: any): boolean;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user