Blame view

node_modules/continuation-local-storage/test/async-context.tap.js 504 Bytes
f7563de62   Palak Handa   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  'use strict';
  
  var tap             = require('tap')
    , test            = tap.test
    , createNamespace = require('../context.js').createNamespace
    ;
  
  test("asynchronously propagating state with local-context-domains", function (t) {
    t.plan(2);
  
    var namespace = createNamespace('namespace');
    t.ok(process.namespaces.namespace, "namespace has been created");
  
    namespace.run(function () {
      namespace.set('test', 1337);
      t.equal(namespace.get('test'), 1337, "namespace is working");
    });
  });