This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>BaseViewModel.js specs</title> | |
<link rel="stylesheet" type="text/css" href="../node_modules/mocha/mocha.css"> | |
</head> | |
<body> | |
<div id="mocha"></div> | |
<script src="../node_modules/mocha/mocha.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option 1. | |
If you have access to the blanket script tag | |
<script data-cover-filter="src/" src="blanket.js"></script> | |
Option 2. | |
Create a new script block and set the blanket options manually |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
if (! jasmine) { | |
throw new Exception("jasmine library does not exist in global namespace!"); | |
} | |
function elapsed(startTime, endTime) { | |
return (endTime - startTime)/1000; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
"http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<title>Jasmine Spec Runner</title> | |
<link rel="stylesheet" type="text/css" href="jasmine/jasmine.css"/> | |
<script type="text/javascript" src="jasmine/jasmine.js"></script> | |
<script type="text/javascript" src="jasmine/jasmine-html.js"></script> | |
<link rel="shortcut icon" type="image/png" href="jasmine/jasmine_favicon.png"/> | |
<!--<script type="text/javascript" src="Coverage/blanket_jasmine.js" data-cover-flags="ignoreError autoStart" data-cover-only="code/"></script>--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="require.js" /> | |
/// <reference path="qunit.js" /> | |
define(['../tests/base/base.qunit.test', | |
'../tests/ui/ui.qunit.test'], | |
function (){} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Coverage</title> | |
<script> | |
headings = []; | |
onload = function(){ | |
headings = document.querySelectorAll('h2'); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require("fs"); | |
var oldLoader = require.extensions['.js']; | |
//find current scripts | |
require.extensions['.js'] = function(module, filename) { | |
if (filename.indexOf("/src/") > -1){ | |
var content = fs.readFileSync(filename, 'utf8'); | |
// Parse the file content and give to module.exports | |
var covintro = "/* automatically generated by JSCoverage - do not edit */"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//used to wrap requirejs in our code | |
var _ = require("underscore"), | |
fs = require("fs"); | |
var template = fs.readFileSync(__dirname+"/template",'utf8'); | |
var requirejs = fs.readFileSync(__dirname+"/require.js",'utf8'); | |
var compiled = _.template(template); | |
var result = compiled({requirejs: requirejs}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var falafel = require('falafel'); | |
var intro = "\"tracking code start\";\n"; | |
var checkForOneLiner = function (node) { | |
if (linesToAddBrackets.indexOf(node.type) > -1){ | |
var bracketsExistObject = node.consequent || node.body; | |
if( bracketsExistObject && bracketsExistObject.type != "BlockStatement") { | |
bracketsExistObject.update("{\n"+bracketsExistObject.source()+"\n}"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sample on how to use the parser and walker API to instrument some code | |
var jsp = require("uglify-js").parser; | |
var pro = require("uglify-js").uglify; | |
function instrument(code) { | |
var ast = jsp.parse(code, false, true); // true for the third arg specifies that we want | |
// to have start/end tokens embedded in the | |
// statements | |
var w = pro.ast_walker(); |
NewerOlder