Debian Codegraph @

test/instrumentation/test-es6-export.js

raw
1 /*jslint nomen: true */
2 var helper = require('../helper'),
3 code,
4 verifier;
5
6 if (require('../es6').isExportAvailable()) {
7 module.exports = {
8 'should cover export statements': function (test) {
9 code = [
10 'export function bar() { return 2 }',
11 'output = bar()'
12 ];
13 verifier = helper.verifier(__filename, code, {
14 esModules: true,
15 noAutoWrap: true
16 });
17 verifier.verify(test, [], 2, {
18 lines: {'1': 1, '2': 1},
19 branches: {},
20 functions: {'1': 1},
21 statements: {'1': 1, '2': 1, '3': 1}
22 });
23 test.done();
24 },
25
26 'should cover export declarations': function (test) {
27 code = [
28 'export var a = 2, b = 3;',
29 'output = a + b'
30 ];
31 verifier = helper.verifier(__filename, code, {
32 esModules: true,
33 noAutoWrap: true
34 });
35 verifier.verify(test, [], 5, {
36 lines: {'1':1, '2': 1},
37 branches: {},
38 functions: {},
39 statements: {'1': 1, '2': 1}
40 });
41 test.done();
42 }
43 };
44 }