node/test/parallel/test-global.js

19 lines
524 B
JavaScript
Raw Normal View History

2010-12-05 07:20:34 +08:00
var common = require('../common');
var assert = require('assert');
2010-08-18 23:47:36 +08:00
2010-12-05 05:40:39 +08:00
common.globalCheck = false;
baseFoo = 'foo';
global.baseBar = 'bar';
2010-08-18 23:47:36 +08:00
assert.equal('foo', global.baseFoo, 'x -> global.x in base level not working');
2010-08-18 23:47:36 +08:00
assert.equal('bar', baseBar, 'global.x -> x in base level not working');
2010-08-18 23:47:36 +08:00
var module = require('../fixtures/global/plain'),
fooBar = module.fooBar;
2010-08-18 23:47:36 +08:00
assert.equal('foo', fooBar.foo, 'x -> global.x in sub level not working');
2010-08-18 23:47:36 +08:00
assert.equal('bar', fooBar.bar, 'global.x -> x in sub level not working');