0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 07:53:06 +01:00
nodejs/test/simple/test-global.js

19 lines
524 B
JavaScript
Raw Normal View History

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