Skip to content

Commit

Permalink
test: renamed unit to integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
amoncaldas committed Oct 12, 2021
1 parent 2121dd1 commit d978fc5
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 10 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/github-actions-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }} and ORSKEY ${{ secrets.ORSKEY }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
env:
ORSKEY: ${{ secrets.ORSKEY }}
- run: npm install
- run: cd src && cp config-examples/* config && for i in config/*-example.js; do mv -- "$i" "${i%-example.js}.js"; done
- run: echo env.ORSKEY
- run: npm run integration
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/test/integration/coverage/
/test/unit/coverage/
/test/e2e/reports/
selenium-debug.log
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"integration": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js",
"integration-debug": "cross-env BABEL_ENV=test karma start test/unit/karma.debug.conf.js",
"integration": "cross-env BABEL_ENV=test karma start test/integration/karma.conf.js",
"integration-debug": "cross-env BABEL_ENV=test karma start test/integration/karma.debug.conf.js",
"e2e": "node test/e2e/runner.js",
"test": "npm run integration && npm run e2e",
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs",
"lint": "eslint --ext .js,.vue src test/integration/specs test/e2e/specs",
"build": "node build/build.js",
"commit": "git-cz",
"release": "standard-version"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// eslint-disable-next-line no-undef
const testWebpackConfig = require('../../build/webpack.test.conf')

process.env.ORSKEY =
'5b3ce3597851110001cf62484c2b303725d843b5b765b5e83e8e3c30'

// eslint-disable-next-line no-undef
module.exports = function (config) {
config.set({
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ describe('OrsApiRunner test', () => {
expect(response.content.features[0].geometry.type).toEqual('LineString')
done()
}).catch(result => {
const error = lodash.get(result, 'response.response.body.error') || result.response
let error = {
key: process.env.ORSKEY,
error: lodash.get(result, 'response.response.body.error') || result.response
}
done.fail(error)
})
}).catch(result => {
Expand All @@ -44,7 +47,10 @@ describe('OrsApiRunner test', () => {
expect(response.content.features[0].geometry.type).toEqual('Polygon')
done()
}).catch(result => {
const error = lodash.get(result, 'response.response.body.error') || result.response
let error = {
key: process.env.ORSKEY,
error: lodash.get(result, 'response.response.body.error') || result.response
}
done.fail(error)
})
}).catch(result => {
Expand All @@ -61,7 +67,10 @@ describe('OrsApiRunner test', () => {
expect(places.length).toBeGreaterThan(10)
done()
}).catch(result => {
const error = lodash.get(result, 'response.response.body.error') || result.response
let error = {
key: process.env.ORSKEY,
error: lodash.get(result, 'response.response.body.error') || result.response || result
}
done.fail(error)
})
}).catch(result => {
Expand All @@ -78,13 +87,14 @@ describe('OrsApiRunner test', () => {
expect(places.length).toBeGreaterThan(9)
done()
}).catch(result => {
const error = lodash.get(result, 'response.response.body.error') || result.response
let error = {
key: process.env.ORSKEY,
error: lodash.get(result, 'response.response.body.error') || result.response
}
done.fail(error)
})
}).catch(result => {
done.fail(result)
})
})


})
})

0 comments on commit d978fc5

Please sign in to comment.