Merge branch 'master' into fix/issue-110-update-mapbox-style-spec

This commit is contained in:
orangemug 2017-04-08 22:41:26 +01:00
commit ac8ae0da66
11 changed files with 110 additions and 56 deletions

View file

@ -1,13 +1,26 @@
language: node_js
addons:
firefox: latest
os:
- linux
- osx
node_js:
- "4.6"
- "5.11"
- "6.1"
matrix:
include:
- os: linux
node_js: "4"
- os: linux
env: CXX=g++-4.8
node_js: "5"
- os: linux
node_js: "6"
- os: linux
env: CXX=g++-4.8
node_js: "7"
- os: osx
node_js: "4"
- os: osx
node_js: "5"
- os: osx
node_js: "6"
- os: osx
node_js: "7"
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
@ -20,3 +33,9 @@ script:
- npm run lint
- npm run lint-styles
- npm run test
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8

View file

@ -1,11 +1,15 @@
environment:
matrix:
- nodejs_version: "4.6"
- nodejs_version: "5.11"
- nodejs_version: "6.1"
- nodejs_version: "4"
- nodejs_version: "6"
- nodejs_version: "7"
platform:
- x86
- x64
install:
- ps: Install-Product node $env:nodejs_version
- md public
- npm install --global --production windows-build-tools
- npm install
build_script:
- npm run build

47
config/wdio.conf.js Normal file
View file

@ -0,0 +1,47 @@
var webpack = require("webpack");
var WebpackDevServer = require("webpack-dev-server");
var webpackConfig = require("./webpack.config");
var testConfig = require("../test/config/specs");
var server;
exports.config = {
specs: [
'./test/specs/**/*.js'
],
exclude: [
],
maxInstances: 10,
capabilities: [{
maxInstances: 5,
browserName: 'firefox'
}],
sync: true,
logLevel: 'silent',
coloredLogs: true,
bail: 0,
screenshotPath: './errorShots/',
baseUrl: 'http://localhost',
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
services: ['phantomjs'],
framework: 'mocha',
reporters: ['spec'],
mochaOpts: {
ui: 'bdd',
// Because we don't know how long the initial build will take...
timeout: 2*60*1000
},
onPrepare: function (config, capabilities) {
var compiler = webpack(webpackConfig);
server = new WebpackDevServer(compiler, {
stats: "minimal"
});
server.listen(testConfig.port);
},
onComplete: function(exitCode) {
server.close();
}
}

View file

@ -1,34 +0,0 @@
var webpackConfig = require('./webpack.config.js');
// Karma configuration
module.exports = function(config) {
var browsers = ['Chrome'];
if (process.env.TRAVIS) {
browsers = ['Firefox'];
}
config.set({
browsers: browsers,
frameworks: ['mocha'],
// ... normal karma configuration
files: [
// all files ending in "_test"
{pattern: 'test/*_test.js', watched: false},
{pattern: 'test/**/*_test.js', watched: false}
// each file acts as entry point for the webpack configuration
],
preprocessors: {
// add webpack as preprocessor
'test/*_test.js': ['webpack'],
'test/**/*_test.js': ['webpack']
},
webpack: webpackConfig,
webpackMiddleware: {
// webpack-dev-middleware configuration
// i. e.
stats: 'errors-only'
}
});
};

View file

@ -4,11 +4,11 @@
"description": "A MapboxGL visual style editor",
"main": "''",
"scripts": {
"stats": "webpack --config webpack.production.config.js --profile --json > stats.json",
"build": "webpack --config webpack.production.config.js --progress --profile --colors",
"test": "karma start --single-run",
"test-watch": "karma start",
"start": "webpack-dev-server --progress --profile --colors --watch-poll",
"stats": "webpack --config config/webpack.production.config.js --profile --json > stats.json",
"build": "webpack --config config/webpack.production.config.js --progress --profile --colors",
"test": "wdio config/wdio.conf.js",
"test-watch": "wdio config/wdio.conf.js --watch",
"start": "webpack-dev-server --progress --profile --colors --watch-poll --config config/webpack.config.js",
"lint": "eslint --ext js --ext jsx {src,test}",
"lint-styles": "stylelint 'src/styles/*.scss'"
},
@ -124,6 +124,10 @@
"stylelint-config-standard": "^15.0.1",
"transform-loader": "^0.2.3",
"url-loader": "0.5.7",
"wdio-mocha-framework": "^0.5.9",
"wdio-phantomjs-service": "^0.2.2",
"wdio-spec-reporter": "^0.1.0",
"webdriverio": "^4.6.2",
"webpack": "1.14.0",
"webpack-cleanup-plugin": "^0.4.1",
"webpack-dev-server": "1.16.2"

6
test/config/specs.js Normal file
View file

@ -0,0 +1,6 @@
var config = {};
config.port = 9001;
config.baseUrl = "http://localhost:"+config.port;
module.exports = config;

View file

@ -1,7 +0,0 @@
import assert from 'assert'
describe('Component', () => {
it('#always successds', () => {
assert.equal(1, 1)
})
})

15
test/specs/simple.js Normal file
View file

@ -0,0 +1,15 @@
var assert = require('assert');
var config = require("../config/specs");
describe('maputnik', function() {
it('check logo exists', function () {
browser.url(config.baseUrl);
browser.waitForExist(".maputnik-toolbar-link");
var src = browser.getAttribute(".maputnik-toolbar-link img", "src");
assert.equal(src, config.baseUrl+'/img/maputnik.png');
});
});