Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit c99398b

Browse files
committed
Added E2E tests, coverage reports, and removed three-orbitcontrols
1 parent e82b073 commit c99398b

File tree

20 files changed

+4952
-1983
lines changed

20 files changed

+4952
-1983
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ module.exports = {
5252
{
5353
files: [
5454
'**/__tests__/*.{j,t}s?(x)',
55-
'**/tests/unit/**/*.spec.{j,t}s?(x)'
55+
'**/tests/unit/**/*.spec.{j,t}s?(x)',
56+
'**/tests/e2e/**/*.{j,t}s?(x)',
5657
],
5758
env: {
5859
mocha: true

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
node_modules
33
/dist
44

5-
/tests/e2e/reports/
6-
selenium-debug.log
7-
chromedriver.log
8-
geckodriver.log
5+
# Cypress
6+
tests/e2e/screenshots/*
7+
tests/e2e/videos/*
98

109
# local env files
1110
.env.local

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
module.exports = {
6+
plugins: ['istanbul'],
67
presets: [
78
'@vue/cli-plugin-babel/preset'
89
]

cypress.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"pluginsFile": "tests/e2e/plugins/index.js"
3+
}

nyc.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @fileoverview NYC config
3+
*/
4+
5+
module.exports = {
6+
exclude: [
7+
'.eslintrc.js',
8+
'*.config.js',
9+
'dist/*',
10+
'tests/*'
11+
]
12+
};

package-lock.json

Lines changed: 4620 additions & 1922 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,64 @@
11
{
22
"name": "vue-gcode-viewer",
33
"version": "1.2.0",
4-
"main": "dist/vue-gcode-viewer.common.js",
4+
"author": "Cloud CNC",
55
"scripts": {
6-
"serve": "vue-cli-service serve src/demo/main.js",
7-
"build": "vue-cli-service build --target lib --name vue-gcode-viewer src/main.js",
86
"build:demo": "vue-cli-service build src/demo/main.js",
9-
"coverage": "nyc --reporter=lcov vue-cli-service test:unit",
10-
"test:unit:debug": "vue-cli-service test:unit --inspect-brk --watch --timeout 60000",
11-
"test:unit": "vue-cli-service test:unit",
12-
"lint": "vue-cli-service lint"
13-
},
14-
"repository": {
15-
"type": "git",
16-
"url": "git+https://github.com/Cloud-CNC/vue-gcode-viewer.git"
17-
},
18-
"keywords": [
19-
"vue",
20-
"gcode",
21-
"gcode-viewer",
22-
"vue-gcode-viewer",
23-
"gcode-visualizer",
24-
"gcode-parser",
25-
"cloud-cnc"
26-
],
27-
"author": "Cloud CNC",
28-
"license": "MIT",
29-
"bugs": {
30-
"url": "https://github.com/Cloud-CNC/vue-gcode-viewer/issues"
7+
"build": "vue-cli-service build --target lib --name vue-gcode-viewer src/main.js",
8+
"coverage": "npm run test:unit && npm run test:e2e && nyc report --reporter=lcov",
9+
"lint": "vue-cli-service lint",
10+
"serve": "vue-cli-service serve src/demo/main.js",
11+
"test:e2e": "concurrently --kill-others --success first \"npm:serve\" \"vue-cli-service test:e2e --headless --url http://localhost:8080\"",
12+
"test:unit": "nyc --no-clean --silent vue-cli-service test:unit"
3113
},
32-
"homepage": "https://github.com/Cloud-CNC/vue-gcode-viewer#readme",
14+
"main": "dist/vue-gcode-viewer.common.js",
3315
"files": [
3416
"dist/*",
3517
"src/*"
3618
],
3719
"dependencies": {
3820
"core-js": "^3.6.4",
3921
"three": "^0.116.1",
40-
"three-orbitcontrols": "^2.110.3",
4122
"vue": "^2.6.11"
4223
},
4324
"devDependencies": {
25+
"@cypress/code-coverage": "^3.7.4",
26+
"@mdi/font": "^5.2.45",
4427
"@vue/cli-plugin-babel": "~4.3.0",
28+
"@vue/cli-plugin-e2e-cypress": "^4.3.1",
4529
"@vue/cli-plugin-eslint": "~4.3.0",
4630
"@vue/cli-plugin-unit-mocha": "~4.3.0",
4731
"@vue/cli-service": "~4.3.0",
4832
"@vue/test-utils": "1.0.0-beta.31",
4933
"babel-eslint": "^10.1.0",
34+
"babel-plugin-istanbul": "^6.0.0",
5035
"chai": "^4.1.2",
36+
"concurrently": "^5.2.0",
5137
"eslint": "^6.7.2",
5238
"eslint-plugin-vue": "^6.2.2",
39+
"geckodriver": "^1.19.1",
5340
"nyc": "^15.0.1",
5441
"raw-loader": "^4.0.1",
5542
"vue-cli-plugin-vuetify": "^2.0.5",
5643
"vue-template-compiler": "^2.6.11",
57-
"vuetify": "^2.2.28"
44+
"vuetify": "^2.2.29"
45+
},
46+
"bugs": {
47+
"url": "https://github.com/Cloud-CNC/vue-gcode-viewer/issues"
48+
},
49+
"homepage": "https://github.com/Cloud-CNC/vue-gcode-viewer#readme",
50+
"keywords": [
51+
"vue",
52+
"gcode",
53+
"gcode-viewer",
54+
"vue-gcode-viewer",
55+
"gcode-visualizer",
56+
"gcode-parser",
57+
"cloud-cnc"
58+
],
59+
"license": "MIT",
60+
"repository": {
61+
"type": "git",
62+
"url": "git+https://github.com/Cloud-CNC/vue-gcode-viewer.git"
5863
}
5964
}

public/favicon.ico

-4.19 KB
Binary file not shown.

public/index.html

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/assets/scene.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import
1515
Scene,
1616
WebGLRenderer
1717
} from 'three';
18-
import OrbitControls from 'three-orbitcontrols';
18+
import {OrbitControls} from 'three/examples/jsm/controls/OrbitControls';
1919
import utils from './utils';
2020

2121
//State
@@ -129,6 +129,15 @@ const setup = async (canvas, bed, theme, gcode, position, rotation, scale) =>
129129
}
130130
};
131131
animate();
132+
133+
//Environment
134+
if (process.env.NODE_ENV == 'development' || process.env.NODE_ENV == 'testing')
135+
{
136+
window.getVueGcodeViewerState = () =>
137+
{
138+
return state;
139+
};
140+
}
132141
};
133142

134143
/**

0 commit comments

Comments
 (0)