-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix test coverage #62
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist/** -diff | ||
yarn.lock -diff | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
const TARGETS = { | ||
"chrome": "60", | ||
"edge": "15", | ||
"firefox": "53", | ||
"ios": "10.3", | ||
"safari": "10.1", | ||
"node": "8" | ||
}; | ||
|
||
const CONFIG = { | ||
default: { | ||
"presets": [ | ||
[ "@babel/env", { | ||
"targets": TARGETS | ||
}] | ||
], | ||
"plugins": [ | ||
"version-inline", | ||
"@babel/proposal-class-properties" | ||
], | ||
} | ||
}; | ||
|
||
CONFIG.es6 = Object.assign({}, CONFIG.default, { | ||
"presets": [ | ||
[ "@babel/env", { | ||
"targets": TARGETS, | ||
"modules": false | ||
}] | ||
] | ||
}); | ||
|
||
CONFIG.esm = Object.assign({}, CONFIG.default, { | ||
"presets": [ | ||
[ "@babel/env", { | ||
"modules": false | ||
}] | ||
] | ||
}); | ||
|
||
CONFIG.es5 = Object.assign({}, CONFIG.default, { | ||
"presets": [ | ||
[ "@babel/env", { | ||
"modules": "commonjs" | ||
}] | ||
], | ||
}); | ||
|
||
CONFIG.cover = Object.assign({}, CONFIG.default); | ||
CONFIG.cover.plugins = CONFIG.cover.plugins.concat(['istanbul']); | ||
|
||
module.exports = function getConfig(api) { | ||
|
||
// eslint-disable-next-line | ||
var env = api.cache(() => process.env.BABEL_ENV || process.env.NODE_ENV); | ||
|
||
const config = CONFIG[env] || CONFIG.default; | ||
// Uncomment to debug | ||
console.error(env, config.plugins); | ||
return config; | ||
}; | ||
|
||
module.exports.config = CONFIG.es6; |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/sh | ||
# Automated tests | ||
|
||
set -e | ||
|
||
BASEDIR=$(dirname "$0") | ||
|
||
MODE=$1 | ||
|
||
run_lint() { | ||
npm run lint | ||
# markdownlint docs | ||
} | ||
|
||
run_full_test() { | ||
run_lint | ||
node test/start.js test src | ||
node test/start.js test browser | ||
# node test/start.js render | ||
} | ||
|
||
case $MODE in | ||
"") | ||
run_full_test; | ||
echo "Ran 'full' test by default. Other options:" | ||
echo "test [ 'full' | fast' | 'bench' | 'ci' | 'cover' | 'examples' | 'lint' | size-es6' ]" | ||
break;; | ||
|
||
"full") | ||
run_full_test; | ||
break;; | ||
|
||
"lint") | ||
run_lint | ||
break;; | ||
|
||
"fast") | ||
node test/start.js fast | ||
break;; | ||
|
||
"cover") | ||
echo "HERE" | ||
# Seems to need to be run from each package.json root... | ||
(cd $BASEDIR/../modules/parser && NODE_ENV=test BABEL_ENV=cover npx nyc node ../../test/start.js cover) | ||
echo "HERE" | ||
npx nyc report | ||
break;; | ||
|
||
"dist") | ||
npm run build | ||
node test/start.js test-dist | ||
break;; | ||
|
||
"examples") | ||
node test/node-examples.js | ||
break;; | ||
|
||
"bench") | ||
node test/start.js bench | ||
node test/start.js bench-browser | ||
break;; | ||
|
||
"size-es6") | ||
npm run build | ||
NODE_ENV=production webpack --config test/webpack.config.js --env.import-nothing --env.es6 | ||
break;; | ||
|
||
"ci") | ||
# run by Travis CI | ||
node test/start.js bench | ||
$BASEDIR/collect-metrics-fast.sh | ||
npm run cover | ||
(cd $BASEDIR/../modules/core && npm run build-es6) | ||
break;; | ||
|
||
|
||
*) | ||
# default test | ||
node test/start.js $MODE | ||
break;; | ||
esac |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
// Copyright (c) 2015 - 2017 Uber Technologies, Inc. | ||
// | ||
// 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. | ||
|
||
require('tap-browser-color')(); | ||
require('./index'); | ||
|
||
const test = require('tape'); | ||
|
||
const {callExposedFunction} = require('probe.gl/test-utils'); | ||
|
||
test.onFinish(() => callExposedFunction('testDone', {success: true})); | ||
test.onFailure(() => callExposedFunction('testDone', {success: false})); | ||
|
||
test('Browser tests', t => { | ||
require('./index'); | ||
t.end(); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Set up a configuration (TODO/OSS - this should be a neutral config) | ||
import './modules/builder'; | ||
import './modules/parser'; | ||
import './modules/schema'; | ||
// import './modules/schema'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this breaking something? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment out before merging