mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
The promise package needs a weak dependency on this package (on the server) because meteor-promise saves a reference to Fiber.yield, so we need to have wrapped Fiber.yield with noContext before that happens.
13 lines
365 B
JavaScript
13 lines
365 B
JavaScript
import { Tinytest } from "meteor/tinytest";
|
|
import { Slot } from "meteor/context";
|
|
|
|
Tinytest.add('context - basic Slot usage', function (test) {
|
|
const slot = new Slot();
|
|
test.equal(slot.hasValue(), false);
|
|
slot.withValue(123, () => {
|
|
test.equal(slot.hasValue(), true);
|
|
test.equal(slot.getValue(), 123);
|
|
});
|
|
test.equal(slot.hasValue(), false);
|
|
});
|