Added index.html to the project, because we are not building it anymore.

This commit is contained in:
Spencer Alger 2014-03-07 11:38:09 -07:00
parent 84e24a975c
commit eb35d0ed84
2 changed files with 77 additions and 2 deletions

3
.gitignore vendored
View file

@ -1,3 +1,2 @@
.DS_Store
node_modules
test/unit/index.html
node_modules

76
test/unit/index.html Normal file
View file

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html>
<head>
<title>Kibana4 Tests</title>
<link rel="stylesheet" href="/node_modules/mocha/mocha.css" />
<script src="/node_modules/expect.js/expect.js"></script>
<script src="/node_modules/mocha/mocha.js"></script>
<script src="/src/bower_components/requirejs/require.js"></script>
<script src="/src/kibana/require.config.js"></script>
<script>(function () {
var COVERAGE = !!(/coverage/i.test(window.location.search));
mocha.setup({
ui: 'bdd',
reporter: 'html'
});
require.config({
baseUrl: '/src/kibana',
paths: {
test_utils: '../../test/utils',
fixtures: '../../test/unit/fixtures',
specs: '../../test/unit/specs',
sinon: '../../test/utils/sinon'
},
shim: {
'sinon/sinon': {
deps: [
'sinon/sinon-timers-1.8.2'
],
exports: 'sinon'
}
},
// mark all requested files with instrument query param
urlArgs: COVERAGE ? 'instrument=true' : void 0
});
function setupCoverage(done) {
document.title = document.title.replace('Tests', 'Coverage');
require([
'test_utils/istanbul_reporter/reporter'
], function (IstanbulReporter) {
mocha.reporter(IstanbulReporter);
done();
});
}
function runTests() {
require([
'sinon/sinon',
'specs/apps/dashboard/index',
'specs/courier/index'
], function (sinon) {
var xhr = sinon.useFakeXMLHttpRequest();
xhr.onCreate = function () {
throw new Error('Tests should not be sending XHR requests');
};
window.mochaRunner = mocha.run().on('end', function () {
window.mochaResults = this.stats;
xhr.restore();
});
});
}
if (COVERAGE) {
setupCoverage(runTests);
} else {
runTests();
}
})();</script>
</head>
<body><div id="mocha"></div></body>
</html>