Private GIT

Skip to content
Snippets Groups Projects
Commit bab57783 authored by Alexis Tyler's avatar Alexis Tyler Committed by GitHub
Browse files

add ava testing (#3930)

* add ava testing

* move js tests to tests/js

* fix test content

* switch ava to using package.json config
parent 81a1436a
No related branches found
No related tags found
No related merge requests found
......@@ -11,10 +11,13 @@
},
"homepage": "https://github.com/SickRage/SickRage#readme",
"scripts": {
"test": "xo && grunt",
"test": "xo --verbose && ava --verbose",
"security": "snyk test"
},
"dependencies": {},
"devDependencies": {
"ava": "^0.21.0",
"browser-env": "^3.1.0",
"grunt": "^1.0.1",
"grunt-bower-concat": "^1.0.0",
"grunt-bower-task": "^0.5.0",
......@@ -28,11 +31,26 @@
"grunt-contrib-watch": "^1.0.0",
"grunt-exec": "^2.0.0",
"grunt-po2json": "git+https://github.com/rockykitamura/grunt-po2json.git",
"jquery": "^3.2.1",
"load-grunt-tasks": "^3.5.2",
"npm-check-updates": "^2.10.5",
"snyk": "^1.28.1",
"xo": "^0.18.2"
},
"ava": {
"require": [
"./tests/js/helpers/setup-browser-env.js"
],
"files": [
"tests/js/**/*.js"
],
"source": [
"gui/slick/js/**/*.{js,jsx}",
"!dist/**/*",
"!lib/**/*",
"!**/*.min.js"
]
},
"xo": {
"space": 4,
"rules": {
......
const browserEnv = require('browser-env');
browserEnv();
import test from 'ava';
test.failing('getMeta', t => {
const meta = document.createElement('meta', {
'data-var': 'srRoot',
content: '/sickrage'
});
document.body.appendChild(meta);
t.is(getMeta('srRoot'), '/sickrage');
});
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment