Skip to content

Commit

Permalink
test: add unit test infrastructure with vue-test-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
amoncaldas committed Oct 21, 2021
1 parent 0e81f83 commit a3cf6eb
Show file tree
Hide file tree
Showing 1,001 changed files with 244,572 additions and 50 deletions.
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
preset: '@vue/cli-plugin-unit-jest/presets/no-babel'
}
680 changes: 649 additions & 31 deletions package-lock.json

Large diffs are not rendered by default.

42 changes: 24 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"name": "ors-maps-client",
"version": "1.21.2",
"repository": "https://github.com/GIScience/ors-map-client",
"license": "MIT",
"private": false,
"description": "Openrouteservice maps client",
"author": "amon@openrouteservice.org",
"private": false,
"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/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/integration/specs test/e2e/specs",
"build": "node build/build.js",
"lint": "eslint --ext .js,.vue src tests/integration/specs tests/e2e/specs",
"commit": "git-cz",
"release": "standard-version"
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"release": "standard-version",
"start": "npm run dev",
"test:unit": "cross-env BABEL_ENV=test karma start tests/unit/karma.conf.js",
"test:unit-debug": "cross-env BABEL_ENV=test karma start tests/unit/karma.debug.conf.js",
"test:e2e": "node tests/e2e/runner.js",
"test": "npm run test:integration && npm run test:e2e",
"test:integration": "cross-env BABEL_ENV=test karma start tests/integration/karma.conf.js",
"test:integration-debug": "cross-env BABEL_ENV=test karma start tests/integration/karma.debug.conf.js"
},
"dependencies": {
"@babel/eslint-parser": "^7.11.3",
Expand Down Expand Up @@ -64,15 +64,19 @@
},
"devDependencies": {
"@babel/cli": "^7.14.8",
"@babel/core": "^7.15.0",
"@babel/core": "^7.15.8",
"@babel/node": "^7.14.9",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
"@babel/plugin-transform-runtime": "^7.11.0",
"@babel/preset-env": "^7.11.0",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.15.8",
"@types/leaflet": "^1.5.17",
"@vue/babel-plugin-transform-vue-jsx": "^1.2.1",
"@vue/test-utils": "^1.2.2",
"autoprefixer": "^7.1.2",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^27.3.1",
"babel-loader": "^8.1.0",
"babel-plugin-add-module-exports": "^1.0.0",
"babel-plugin-istanbul": "^4.1.1",
Expand Down Expand Up @@ -153,10 +157,6 @@
"webpack-karma-jasmine": "^4.0.0",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 12.0.0",
"npm": ">= 6.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
Expand All @@ -166,5 +166,11 @@
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
},
"engines": {
"node": ">= 12.0.0",
"npm": ">= 6.0.0"
},
"license": "MIT",
"repository": "https://github.com/GIScience/ors-map-client"
}
2 changes: 1 addition & 1 deletion src/fragments/forms/place-input/PlaceInput.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div v-click-outside="setFocus" :id="predictableId" >
<div v-click-outside="setFocus" :id="predictableId" class="place-input-component" >
<v-layout row wrap >
<v-flex v-bind="{[inputColumns]: true}">
<v-text-field class="place-input"
Expand Down
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions tests/e2e/reports/CHROME_92.0.4515.131__app-render.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites errors="1"
failures="1"
tests="1">

<testsuite name="app-render"
errors="1" failures="1" hostname="" id="" package="app-render" skipped="0"
tests="1" time="70.15" timestamp="">

<testcase name="app render" classname="app-render" time="70.15" assertions="1"> <failure message="Timed out while waiting for element &lt;#app&gt; to be present for 10000 milliseconds. - expected &#34;visible&#34; but got: &#34;not found&#34; (10134ms)"> at Object.appRender [as app render] (/home/amon/apps/ors-map-client/test/e2e/specs/app-render.js:28:8)
at processTicksAndRejections (internal/process/task_queues.js:95:5)</failure>


<error message="Timed out while waiting for element &lt;#app&gt; to be present for 10000 milliseconds. - expected [0;32m&#34;visible&#34;[0m but got: [0;31m&#34;not found&#34;[0m [0;90m(10134ms)[0m" type="error"><![CDATA[
at Object.appRender [as app render] (/home/amon/apps/ors-map-client/test/e2e/specs/app-render.js:28:8)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
]]></error>

</testcase>



<system-err>
Error: Error while running .url(): Error ECONNRESET: socket hang up
at processTicksAndRejections (internal/process/task_queues.js:95:5)
</system-err>





</testsuite>
</testsuites>
22 changes: 22 additions & 0 deletions tests/e2e/reports/CHROME_92.0.4515.131__test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites errors="0"
failures="0"
tests="0">

<testsuite name="test"
errors="0" failures="0" hostname="" id="" package="test" skipped="0"
tests="0" time="0.000" timestamp="">



<system-err>
Error: Error while running .url(): Error ECONNRESET: socket hang up
at processTicksAndRejections (internal/process/task_queues.js:95:5)
</system-err>





</testsuite>
</testsuites>
42 changes: 42 additions & 0 deletions tests/e2e/reports/app-render.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites errors="1"
failures="0"
tests="0">

<testsuite name="app-render"
errors="1" failures="0" hostname="" id="" package="app-render" skipped="1"
tests="0" time="0.000" timestamp="">



<system-err>
Error: An error occurred while retrieving a new session: &#34;session not created: This version of ChromeDriver only supports Chrome version 92&#34;
at endReadableNT (internal/streams/readable.js:1334:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
</system-err>



<error message="An error occurred while retrieving a new session: &#34;session not created: This version of ChromeDriver only supports Chrome version 92&#34;"><![CDATA[
Error: An error occurred while retrieving a new session: &#34;session not created: This version of ChromeDriver only supports Chrome version 92&#34;
at Selenium2Protocol.handleSessionCreateError (/home/amon/apps/ors-map-client/node_modules/nightwatch/lib/transport/transport.js:110:15)
at HttpRequest.&lt;anonymous&gt; (/home/amon/apps/ors-map-client/node_modules/nightwatch/lib/transport/transport.js:166:32)
at HttpRequest.emit (events.js:400:28)
at HttpResponse.&lt;anonymous&gt; (/home/amon/apps/ors-map-client/node_modules/nightwatch/lib/http/request.js:143:19)
at HttpResponse.emit (events.js:400:28)
at IncomingMessage.&lt;anonymous&gt; (/home/amon/apps/ors-map-client/node_modules/nightwatch/lib/http/response.js:60:14)
at IncomingMessage.emit (events.js:412:35)
at endReadableNT (internal/streams/readable.js:1334:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
]]></error>



<testcase
name="app render" classname="app-render">
<skipped />
</testcase>


</testsuite>
</testsuites>
42 changes: 42 additions & 0 deletions tests/e2e/reports/test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites errors="1"
failures="0"
tests="0">

<testsuite name="test"
errors="1" failures="0" hostname="" id="" package="test" skipped="1"
tests="0" time="0.000" timestamp="">



<system-err>
Error: An error occurred while retrieving a new session: &#34;session not created: This version of ChromeDriver only supports Chrome version 92&#34;
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
</system-err>



<error message="An error occurred while retrieving a new session: &#34;session not created: This version of ChromeDriver only supports Chrome version 92&#34;"><![CDATA[
Error: An error occurred while retrieving a new session: &#34;session not created: This version of ChromeDriver only supports Chrome version 92&#34;
at Selenium2Protocol.handleSessionCreateError (/home/amon/apps/ors-map-client/node_modules/nightwatch/lib/transport/transport.js:110:15)
at HttpRequest.&lt;anonymous&gt; (/home/amon/apps/ors-map-client/node_modules/nightwatch/lib/transport/transport.js:166:32)
at HttpRequest.emit (events.js:375:28)
at HttpResponse.&lt;anonymous&gt; (/home/amon/apps/ors-map-client/node_modules/nightwatch/lib/http/request.js:143:19)
at HttpResponse.emit (events.js:375:28)
at IncomingMessage.&lt;anonymous&gt; (/home/amon/apps/ors-map-client/node_modules/nightwatch/lib/http/response.js:60:14)
at IncomingMessage.emit (events.js:387:35)
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
]]></error>



<testcase
name="default e2e tests" classname="test">
<skipped />
</testcase>


</testsuite>
</testsuites>
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit a3cf6eb

Please sign in to comment.