17 lines
608 B
JavaScript
17 lines
608 B
JavaScript
|
import * as smartexpect from './dist_ts/index.js';
|
||
|
class Foo { constructor(){ this.foo='bar'; } }
|
||
|
console.log('foo in instance:', 'foo' in new Foo());
|
||
|
console.log('hasOwn foo:', Object.prototype.hasOwnProperty.call(new Foo(), 'foo'));
|
||
|
try {
|
||
|
smartexpect.expect(new Foo()).object.toHaveProperty('foo');
|
||
|
console.log('toHaveProperty passed');
|
||
|
} catch (err) {
|
||
|
console.error('toHaveProperty failed:', err.message);
|
||
|
}
|
||
|
try {
|
||
|
smartexpect.expect(new Foo()).object.toHaveOwnProperty('foo');
|
||
|
console.log('toHaveOwnProperty passed');
|
||
|
} catch (err) {
|
||
|
console.error('toHaveOwnProperty failed:', err.message);
|
||
|
}
|