2011-12-15 15:12:54 +01:00
|
|
|
|
|
|
|
// JSpec - node - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)
|
|
|
|
|
|
|
|
JSpec
|
|
|
|
.include({
|
|
|
|
name: 'node',
|
2016-01-06 00:34:58 +01:00
|
|
|
|
2011-12-15 15:12:54 +01:00
|
|
|
// --- Matchers
|
2016-01-06 00:34:58 +01:00
|
|
|
|
2011-12-15 15:12:54 +01:00
|
|
|
matchers : {
|
|
|
|
have_enumerable_property: 'actual.propertyIsEnumerable(expected)',
|
|
|
|
have_writable_property: 'Object.getOwnPropertyDescriptor(actual, expected).writable === true',
|
|
|
|
have_configurable_property: 'Object.getOwnPropertyDescriptor(actual, expected).configurable === true',
|
|
|
|
have_keys: 'does(Object.keys(actual), "eql", expected)',
|
|
|
|
have_prototype: 'Object.getPrototypeOf(actual) === expected'
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|