Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce travis ci support and wallabyjs runner
- Reformat the tests so that we're DRY. Use a second beforeEach only assert in tests - add MIT license
- Loading branch information
1 parent
2bf12b5
commit 0bb9688
Showing
8 changed files
with
180 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
language: node_js | ||
dist: trusty | ||
node_js: | ||
- 6.1 | ||
sudo: required | ||
addons: | ||
apt: | ||
sources: | ||
- google-chrome | ||
packages: | ||
- google-chrome-stable | ||
- google-chrome-beta | ||
before_install: | ||
- export CHROME_BIN=chromium-browser | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
- google-chrome --version | ||
install: | ||
- npm install | ||
- npm install codecov | ||
script: | ||
- npm run test -- --single-run=true --browsers Chrome --code-coverage | ||
- ./node_modules/codecov/bin/codecov | ||
- npm run e2e | ||
- npm run lint | ||
- npm run build |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2017 Arran Bartish | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import './polyfills'; | ||
|
||
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'; | ||
|
||
getTestBed().initTestEnvironment( | ||
BrowserDynamicTestingModule, | ||
platformBrowserDynamicTesting() | ||
); |
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
var wallabyWebpack = require('wallaby-webpack'); | ||
|
||
var electronParams = {}; | ||
if(process.env.DISABLE_GPU){ | ||
/* if you are having issues with your GPU such as https://github.com/wallabyjs/public/issues/1076 | ||
* then simply defined an environment variable in the trouble environment DISABLE_GPU=true and electron will use | ||
* chrome environment with the GPU disabled | ||
*/ | ||
electronParams.runner = '--disable-gpu'; | ||
} | ||
|
||
var webpackPostprocessor = wallabyWebpack({ | ||
entryPatterns: [ | ||
'src/wallabyTest.js', | ||
'src/**/*spec.js' | ||
], | ||
|
||
module: { | ||
loaders: [ | ||
{test: /\.css$/, loader: 'raw-loader'}, | ||
{test: /\.html$/, loader: 'raw-loader'}, | ||
{test: /\.js$/, loader: 'angular2-template-loader', exclude: /node_modules/}, | ||
{test: /\.json$/, loader: 'json-loader'}, | ||
{test: /\.styl$/, loaders: ['raw-loader', 'stylus-loader']}, | ||
{test: /\.less$/, loaders: ['raw-loader', 'less-loader']}, | ||
{test: /\.scss$|\.sass$/, loaders: ['raw-loader', 'sass-loader']}, | ||
{test: /\.(jpg|png)$/, loader: 'url-loader?limit=128000'} | ||
] | ||
} | ||
}); | ||
|
||
var compilerOptions = require('./src/tsconfig.spec.json').compilerOptions; | ||
|
||
module.exports = function (wallaby) { | ||
|
||
return { | ||
files: [ | ||
{ pattern: 'src/**/*.ts', load: false }, | ||
{ pattern: 'src/**/*.d.ts', ignore: true }, | ||
{ pattern: 'src/**/*.css', load: false }, | ||
{ pattern: 'src/**/*.less', load: false }, | ||
{ pattern: 'src/**/*.scss', load: false }, | ||
{ pattern: 'src/**/*.sass', load: false }, | ||
{ pattern: 'src/**/*.html', load: false }, | ||
{ pattern: 'src/**/*spec.ts', ignore: true } | ||
], | ||
|
||
tests: [ | ||
{pattern: 'src/**/*spec.ts', load: false} | ||
], | ||
|
||
testFramework: 'jasmine', | ||
|
||
compilers: { | ||
'**/*.ts': wallaby.compilers.typeScript(compilerOptions) | ||
}, | ||
|
||
env: { | ||
kind: 'electron', | ||
params: electronParams | ||
}, | ||
|
||
postprocessor: webpackPostprocessor, | ||
|
||
setup: function () { | ||
window.__moduleBundler.loadTests(); | ||
}, | ||
|
||
debug: true | ||
}; | ||
}; |