Skip to content

Commit

Permalink
Refactor build system and test runner since it no longer ran (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoferbaxter authored Jan 30, 2020
1 parent fbdd64c commit 62909c6
Show file tree
Hide file tree
Showing 14 changed files with 4,513 additions and 12,904 deletions.
7 changes: 3 additions & 4 deletions mobile-web/.babelrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"presets": [
["env", {
["@babel/preset-env", {
"loose": true,
"targets": {
"browsers": ["last 2 versions", "safari >= 7"]
},
"modules": "commonjs"
"browsers": ["last 2 versions", "safari >= 10"]
}
}]
]
}
19 changes: 19 additions & 0 deletions mobile-web/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Unit Tests

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install
- run: yarn build
- run: yarn test
7 changes: 4 additions & 3 deletions mobile-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

| Command | Description |
| ----------------------------------------------------------------------- | --------------------------------------------------------------------- |
| **`gulp`** | Runs "build" |
| **`gulp serve`** or **`gulp watch`** | Runs "build" with watch and runs a localhost webserver |
| **`gulp clean`** | deletes the /dist directory |
| **`yarn build`** | Runs "build" |
| **`yarn watch`** | Runs "build" with watch and runs a localhost webserver |
| **`yarn test`** | executes tests in /tests directory |
| **`yarn clean`** | deletes the /dist directory |
2 changes: 1 addition & 1 deletion mobile-web/example/platform.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>Viewer</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">
<link href='https://fonts.googleapis.com/css?family=Questrial' rel='stylesheet' type='text/css'>
<script src="../dist/viewer.js"></script>
<script src="viewer.js"></script>
<style>
html, body {
overflow: hidden;
Expand Down
89 changes: 0 additions & 89 deletions mobile-web/gulpfile.js

This file was deleted.

82 changes: 39 additions & 43 deletions mobile-web/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,47 @@
* limitations under the License.
*/

module.exports = function(config) {
config.set({
files: ["tests/**/*.js"],

module.exports = {
frameworks: ["browserify", "chai", "mocha", "sinon-chai"],

files: ['tests/**/*.js'],

frameworks: [
'browserify',
'chai',
'mocha',
'sinon-chai',
],

preprocessors: {
'src/**/*.js': ['browserify'],
'tests/**/*.js': ['browserify'],
},

browserify: {
watch: true,
debug: true,
transform: ['babelify'],
bundleDelay: 900,
},

port: 9876,
colors: true,
logLevel: process.env.TRAVIS ? 'ERROR' : 'WARN',
autoWatch: true,
browsers: [
process.env.TRAVIS ? 'Chrome_travis_ci' : 'Chrome_no_extensions',
],

// Number of sauce tests to start in parallel
concurrency: 6,

customLaunchers: {
/*eslint "google-camelcase/google-camelcase": 0*/
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox', '--disable-extensions'],
preprocessors: {
"src/**/*.js": ["browserify"],
"tests/**/*.js": ["browserify"]
},
Chrome_no_extensions: {
base: 'Chrome',
// Dramatically speeds up iframe creation time.
flags: ['--disable-extensions'],

browserify: {
watch: true,
debug: true,
transform: ["babelify"],
bundleDelay: 900
},
},

port: 9876,
colors: true,
logLevel: process.env.TRAVIS ? "ERROR" : "WARN",
autoWatch: true,
browsers: [
process.env.TRAVIS ? "Chrome_travis_ci" : "Chrome_no_extensions"
],
singleRun: true,

// Number of sauce tests to start in parallel
concurrency: 6,

customLaunchers: {
/*eslint "google-camelcase/google-camelcase": 0*/
Chrome_travis_ci: {
base: "Chrome",
flags: ["--no-sandbox", "--disable-extensions"]
},
Chrome_no_extensions: {
base: "Chrome",
// Dramatically speeds up iframe creation time.
flags: ["--disable-extensions"]
}
}
});
};
Loading

0 comments on commit 62909c6

Please sign in to comment.