mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Add ember to project
This commit is contained in:
52
tests/.jshintrc
Normal file
52
tests/.jshintrc
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"predef": [
|
||||
"document",
|
||||
"window",
|
||||
"location",
|
||||
"setTimeout",
|
||||
"$",
|
||||
"-Promise",
|
||||
"define",
|
||||
"console",
|
||||
"visit",
|
||||
"exists",
|
||||
"fillIn",
|
||||
"click",
|
||||
"keyEvent",
|
||||
"triggerEvent",
|
||||
"find",
|
||||
"findWithAssert",
|
||||
"wait",
|
||||
"DS",
|
||||
"andThen",
|
||||
"currentURL",
|
||||
"currentPath",
|
||||
"currentRouteName"
|
||||
],
|
||||
"node": false,
|
||||
"browser": false,
|
||||
"boss": true,
|
||||
"curly": true,
|
||||
"debug": false,
|
||||
"devel": false,
|
||||
"eqeqeq": true,
|
||||
"evil": true,
|
||||
"forin": false,
|
||||
"immed": false,
|
||||
"laxbreak": false,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"noempty": false,
|
||||
"nonew": false,
|
||||
"nomen": false,
|
||||
"onevar": false,
|
||||
"plusplus": false,
|
||||
"regexp": false,
|
||||
"undef": true,
|
||||
"sub": true,
|
||||
"strict": false,
|
||||
"white": false,
|
||||
"eqnull": true,
|
||||
"esversion": 6,
|
||||
"unused": true
|
||||
}
|
||||
5
tests/helpers/destroy-app.js
Normal file
5
tests/helpers/destroy-app.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
export default function destroyApp(application) {
|
||||
Ember.run(application, 'destroy');
|
||||
}
|
||||
24
tests/helpers/module-for-acceptance.js
Normal file
24
tests/helpers/module-for-acceptance.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import {module} from 'qunit';
|
||||
import Ember from 'ember';
|
||||
import startApp from '../helpers/start-app';
|
||||
import destroyApp from '../helpers/destroy-app';
|
||||
|
||||
const {RSVP: {Promise}} = Ember;
|
||||
|
||||
export default function (name, options = {}) {
|
||||
module(name, {
|
||||
beforeEach() {
|
||||
this.application = startApp();
|
||||
|
||||
if (options.beforeEach) {
|
||||
return options.beforeEach.apply(this, arguments);
|
||||
}
|
||||
},
|
||||
|
||||
afterEach() {
|
||||
let afterEach = options.afterEach && options.afterEach.apply(this, arguments);
|
||||
return Promise.resolve(afterEach).then(() = > destroyApp(this.application)
|
||||
)
|
||||
};
|
||||
});
|
||||
}
|
||||
11
tests/helpers/resolver.js
Normal file
11
tests/helpers/resolver.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import Resolver from '../../resolver';
|
||||
import config from '../../config/environment';
|
||||
|
||||
const resolver = Resolver.create();
|
||||
|
||||
resolver.namespace = {
|
||||
modulePrefix: config.modulePrefix,
|
||||
podModulePrefix: config.podModulePrefix
|
||||
};
|
||||
|
||||
export default resolver;
|
||||
17
tests/helpers/start-app.js
Normal file
17
tests/helpers/start-app.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import Ember from 'ember';
|
||||
import Application from '../../app';
|
||||
import config from '../../config/environment';
|
||||
|
||||
export default function startApp(attrs) {
|
||||
let application;
|
||||
|
||||
let attributes = Ember.merge({}, config.APP);
|
||||
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
|
||||
|
||||
Ember.run(() = > {
|
||||
application = Application.create(attributes);
|
||||
application.setupForTesting();
|
||||
application.injectTestHelpers();
|
||||
})
|
||||
return application;
|
||||
}
|
||||
33
tests/index.html
Normal file
33
tests/index.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>PyRIGS Tests</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
{{ content-for "head"}}
|
||||
{{ content-for "test-head"}}
|
||||
|
||||
<link rel="stylesheet" href="{{ rootURL }}assets/vendor.css">
|
||||
<link rel="stylesheet" href="{{ rootURL }}assets/py-rigs.css">
|
||||
<link rel="stylesheet" href="{{ rootURL }}assets/test-support.css">
|
||||
|
||||
{{ content-for "head-footer"}}
|
||||
{{ content-for "test-head-footer"}}
|
||||
</head>
|
||||
<body>
|
||||
{{ content-for "body"}}
|
||||
{{ content-for "test-body"}}
|
||||
|
||||
<script src="{{ rootURL }}testem.js" integrity=""></script>
|
||||
<script src="{{ rootURL }}assets/vendor.js"></script>
|
||||
<script src="{{ rootURL }}assets/test-support.js"></script>
|
||||
<script src="{{ rootURL }}assets/py-rigs.js"></script>
|
||||
<script src="{{ rootURL }}assets/tests.js"></script>
|
||||
|
||||
{{ content-for "body-footer"}}
|
||||
{{ content-for "test-body-footer"}}
|
||||
</body>
|
||||
</html>
|
||||
0
tests/integration/.gitkeep
Normal file
0
tests/integration/.gitkeep
Normal file
6
tests/test-helper.js
Normal file
6
tests/test-helper.js
Normal file
@@ -0,0 +1,6 @@
|
||||
import resolver from './helpers/resolver';
|
||||
import {
|
||||
setResolver
|
||||
} from 'ember-qunit';
|
||||
|
||||
setResolver(resolver);
|
||||
0
tests/unit/.gitkeep
Normal file
0
tests/unit/.gitkeep
Normal file
Reference in New Issue
Block a user