Browser test runner
This commit is contained in:
parent
001bda28d9
commit
c4ba8f8997
|
@ -0,0 +1,27 @@
|
|||
;(function(){
|
||||
|
||||
var __filename = (function(){
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
var a = document.createElement('a');
|
||||
a.href = scripts[scripts.length-1].src;
|
||||
return a.pathname;
|
||||
}());
|
||||
|
||||
var __dirname = __filename.split('/').reverse().slice(1).reverse().join('/');
|
||||
|
||||
document.head.appendChild(function(){
|
||||
var link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.href = __dirname + '/../vendor/jasmine/jasmine.css';
|
||||
return link;
|
||||
}());
|
||||
|
||||
var cacheBust = '?_=' + Date.now().toString(36);
|
||||
|
||||
document.write('<script src="' + __dirname + '/../build/jasmine.js' + cacheBust + '"><\/script>');
|
||||
document.write('<script src="' + __dirname + '/../build/react.js' + cacheBust + '"><\/script>');
|
||||
document.write('<script src="' + __dirname + '/../build/react-test.js' + cacheBust + '"><\/script>');
|
||||
document.write('<script src="' + __dirname + '/../test/the files to test.generated.js' + cacheBust + '"><\/script>');
|
||||
document.write('<script src="' + __dirname + '/../test/jasmine-execute.js' + cacheBust + '"><\/script>');
|
||||
|
||||
}());
|
|
@ -0,0 +1,3 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<script src="browser-runner.js"></script>
|
|
@ -0,0 +1,11 @@
|
|||
;(function(env){
|
||||
// Clean up any nodes the previous test might have added.
|
||||
env.afterEach(function() {
|
||||
harness.removeNextSiblings(document.body);
|
||||
harness.removeNextSiblings(document.getElementById("HTMLReporter"));
|
||||
});
|
||||
|
||||
window.onload = function(){
|
||||
env.execute();
|
||||
}
|
||||
})(jasmine.getEnv());
|
Loading…
Reference in New Issue