Skip to content

Commit

Permalink
#3 Integrate Wallaby (#5)
Browse files Browse the repository at this point in the history
* integrate wallaby

* fix config

* update readme
  • Loading branch information
moshfeu authored Dec 12, 2018
1 parent 9b9c224 commit e2d8c29
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ src/*.js*
config.js
dist
resources
maps
maps
coverage
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Build status](https://ci.appveyor.com/api/projects/status/0vjgy1nnxdp23lyi?svg=true)](https://ci.appveyor.com/project/moshfeu/y2mp3)
[![Build Status](https://travis-ci.com/moshfeu/y2mp3.svg?branch=master)](https://travis-ci.com/moshfeu/y2mp3)
[![Wallaby.js](https://img.shields.io/badge/wallaby.js-configured-green.svg)](https://wallabyjs.com)

<img src="app-resources/logo-128.png" alt="logo" />

Expand Down
22 changes: 22 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
moduleFileExtensions: [
"ts",
"tsx",
"js"
],
transform: {
"^.+\\.(ts|tsx)$": "<rootDir>/test/preprocessor.js"
},
moduleDirectories: [
"node_modules"
],
testMatch: [
"**/?(*.)spec.ts?(x)"
],
timers: "fake",
coverageDirectory: 'coverage',
collectCoverageFrom: [
'src/**/!(*.driver).{js,jsx,ts,tsx}',
'!src/**/*.d.ts',
],
};
21 changes: 3 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"generate-icons": "./node_modules/.bin/electron-icon-maker --input=app-resources/logo-full-size.png --output=resources",
"build": "webpack --config webpack.prod.js",
"test": "node --trace-warnings ./test/runTests.js",
"test:watch": "jest --watch"
"test:watch": "jest --watch",
"coveralls": "jest --coverage && cat ./coverage/lcov.info | coveralls"
},
"dependencies": {
"downloads-folder": "^1.0.1",
Expand All @@ -43,6 +44,7 @@
"@types/react-dom": "^16.0.9",
"@types/sinon": "^5.0.7",
"autoprefixer": "^9.3.1",
"coveralls": "^3.0.2",
"css-loader": "^1.0.1",
"electron": "^3.0.8",
"electron-builder": "^20.28.4",
Expand All @@ -61,23 +63,6 @@
"webpack-cli": "^3.1.2",
"ytdl-core": "^0.26.3"
},
"jest": {
"moduleFileExtensions": [
"ts",
"tsx",
"js"
],
"transform": {
"^.+\\.(ts|tsx)$": "<rootDir>/test/preprocessor.js"
},
"moduleDirectories": [
"node_modules"
],
"testMatch": [
"**/?(*.)spec.ts?(x)"
],
"timers": "fake"
},
"build": {
"appId": "moshfeu.y2mp3",
"files": [
Expand Down
31 changes: 31 additions & 0 deletions wallaby.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = function (wallaby) {

return {
files: [
'src/**/*.{ts?(x),js}',
'test/**/*.{ts?(x),js}',
'!src/**/?(*.)spec.ts?(x)',
'jest.config.js',
'tsconfig.json',
],
tests: ['src/**/?(*.)spec.ts?(x)'],
env: {
type: 'node',
runner: 'node'
},
setup: function (wallaby) {
const jestConfig = require('./jest.config');
delete jestConfig.transform;
delete jestConfig.moduleFileExtensions;
jestConfig.globals = { __DEV__: true };
wallaby.testFramework.configure(jestConfig);
},
testFramework: 'jest',
compilers: {
'**/*.ts?(x)': wallaby.compilers.typeScript()
},
env: {
type: 'node',
},
};
};

0 comments on commit e2d8c29

Please sign in to comment.