mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 16:21:16 +01:00
Merge branch 'master' into fix/issue-110-update-mapbox-style-spec
This commit is contained in:
commit
ac8ae0da66
11 changed files with 110 additions and 56 deletions
33
.travis.yml
33
.travis.yml
|
@ -1,13 +1,26 @@
|
||||||
language: node_js
|
language: node_js
|
||||||
addons:
|
addons:
|
||||||
firefox: latest
|
firefox: latest
|
||||||
os:
|
matrix:
|
||||||
- linux
|
include:
|
||||||
- osx
|
- os: linux
|
||||||
node_js:
|
node_js: "4"
|
||||||
- "4.6"
|
- os: linux
|
||||||
- "5.11"
|
env: CXX=g++-4.8
|
||||||
- "6.1"
|
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:
|
before_install:
|
||||||
- export CHROME_BIN=chromium-browser
|
- export CHROME_BIN=chromium-browser
|
||||||
- export DISPLAY=:99.0
|
- export DISPLAY=:99.0
|
||||||
|
@ -20,3 +33,9 @@ script:
|
||||||
- npm run lint
|
- npm run lint
|
||||||
- npm run lint-styles
|
- npm run lint-styles
|
||||||
- npm run test
|
- npm run test
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- g++-4.8
|
||||||
|
|
10
appveyor.yml
10
appveyor.yml
|
@ -1,11 +1,15 @@
|
||||||
environment:
|
environment:
|
||||||
matrix:
|
matrix:
|
||||||
- nodejs_version: "4.6"
|
- nodejs_version: "4"
|
||||||
- nodejs_version: "5.11"
|
- nodejs_version: "6"
|
||||||
- nodejs_version: "6.1"
|
- nodejs_version: "7"
|
||||||
|
platform:
|
||||||
|
- x86
|
||||||
|
- x64
|
||||||
install:
|
install:
|
||||||
- ps: Install-Product node $env:nodejs_version
|
- ps: Install-Product node $env:nodejs_version
|
||||||
- md public
|
- md public
|
||||||
|
- npm install --global --production windows-build-tools
|
||||||
- npm install
|
- npm install
|
||||||
build_script:
|
build_script:
|
||||||
- npm run build
|
- npm run build
|
||||||
|
|
47
config/wdio.conf.js
Normal file
47
config/wdio.conf.js
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -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'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
14
package.json
14
package.json
|
@ -4,11 +4,11 @@
|
||||||
"description": "A MapboxGL visual style editor",
|
"description": "A MapboxGL visual style editor",
|
||||||
"main": "''",
|
"main": "''",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"stats": "webpack --config webpack.production.config.js --profile --json > stats.json",
|
"stats": "webpack --config config/webpack.production.config.js --profile --json > stats.json",
|
||||||
"build": "webpack --config webpack.production.config.js --progress --profile --colors",
|
"build": "webpack --config config/webpack.production.config.js --progress --profile --colors",
|
||||||
"test": "karma start --single-run",
|
"test": "wdio config/wdio.conf.js",
|
||||||
"test-watch": "karma start",
|
"test-watch": "wdio config/wdio.conf.js --watch",
|
||||||
"start": "webpack-dev-server --progress --profile --colors --watch-poll",
|
"start": "webpack-dev-server --progress --profile --colors --watch-poll --config config/webpack.config.js",
|
||||||
"lint": "eslint --ext js --ext jsx {src,test}",
|
"lint": "eslint --ext js --ext jsx {src,test}",
|
||||||
"lint-styles": "stylelint 'src/styles/*.scss'"
|
"lint-styles": "stylelint 'src/styles/*.scss'"
|
||||||
},
|
},
|
||||||
|
@ -124,6 +124,10 @@
|
||||||
"stylelint-config-standard": "^15.0.1",
|
"stylelint-config-standard": "^15.0.1",
|
||||||
"transform-loader": "^0.2.3",
|
"transform-loader": "^0.2.3",
|
||||||
"url-loader": "0.5.7",
|
"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": "1.14.0",
|
||||||
"webpack-cleanup-plugin": "^0.4.1",
|
"webpack-cleanup-plugin": "^0.4.1",
|
||||||
"webpack-dev-server": "1.16.2"
|
"webpack-dev-server": "1.16.2"
|
||||||
|
|
6
test/config/specs.js
Normal file
6
test/config/specs.js
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
var config = {};
|
||||||
|
|
||||||
|
config.port = 9001;
|
||||||
|
config.baseUrl = "http://localhost:"+config.port;
|
||||||
|
|
||||||
|
module.exports = config;
|
|
@ -1,7 +0,0 @@
|
||||||
import assert from 'assert'
|
|
||||||
|
|
||||||
describe('Component', () => {
|
|
||||||
it('#always successds', () => {
|
|
||||||
assert.equal(1, 1)
|
|
||||||
})
|
|
||||||
})
|
|
15
test/specs/simple.js
Normal file
15
test/specs/simple.js
Normal 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');
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
Loading…
Reference in a new issue