Debian Codegraph @

test/instrumentation/test-with.js

raw
1 /*jslint nomen: true */
2 var helper = require('../helper'),
3 code,
4 verifier;
5
6 /*jshint maxlen: 500 */
7 module.exports = {
8 "with a with statement - no blocks": {
9 setUp: function (cb) {
10 code = [
11 'with (Math) output = abs(args[0]);'
12 ];
13 verifier = helper.verifier(__filename, code);
14 cb();
15 },
16
17 "should cover everything correctly": function (test) {
18 verifier.verify(test, [ -1 ], 1, { lines: { 1: 1 }, branches: {}, functions: {}, statements: { '1': 1, '2': 1 } });
19 test.done();
20 }
21 },
22 "with a with statement - in a block": {
23 setUp: function (cb) {
24 code = [
25 'with (Math) { output = abs(args[0]); }'
26 ];
27 verifier = helper.verifier(__filename, code);
28 cb();
29 },
30
31 "should cover everything correctly": function (test) {
32 verifier.verify(test, [ -1 ], 1, { lines: { 1: 1 }, branches: {}, functions: {}, statements: { '1': 1, '2': 1 } });
33 test.done();
34 }
35 }
36 };
37