08-27-周三_17-09-29
This commit is contained in:
32
node_modules/weak/test/exports.js
generated
vendored
Normal file
32
node_modules/weak/test/exports.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
var assert = require('assert');
|
||||
var weak = require('../')
|
||||
|
||||
function checkFunction (prop) {
|
||||
it('should have a function "' + prop + '"', function () {
|
||||
assert('function' == typeof weak[prop]);
|
||||
})
|
||||
}
|
||||
|
||||
describe('exports', function () {
|
||||
|
||||
afterEach(gc)
|
||||
|
||||
it('should be a function', function () {
|
||||
assert('function' == typeof weak);
|
||||
})
|
||||
|
||||
checkFunction('get')
|
||||
checkFunction('create')
|
||||
checkFunction('isWeakRef')
|
||||
checkFunction('isNearDeath')
|
||||
checkFunction('isDead')
|
||||
checkFunction('callbacks')
|
||||
checkFunction('addCallback')
|
||||
checkFunction('removeCallback')
|
||||
checkFunction('removeCallbacks')
|
||||
|
||||
it('should be a circular reference to "create"', function () {
|
||||
assert(weak === weak.create);
|
||||
})
|
||||
|
||||
})
|
Reference in New Issue
Block a user