main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
514 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var inspect = require('../');
|
---|
| 4 | var test = require('tape');
|
---|
| 5 | var mockProperty = require('mock-property');
|
---|
| 6 |
|
---|
| 7 | test('when Object#hasOwnProperty is deleted', function (t) {
|
---|
| 8 | t.plan(1);
|
---|
| 9 | var arr = [1, , 3]; // eslint-disable-line no-sparse-arrays
|
---|
| 10 |
|
---|
| 11 | t.teardown(mockProperty(Array.prototype, 1, { value: 2 })); // this is needed to account for "in" vs "hasOwnProperty"
|
---|
| 12 | t.teardown(mockProperty(Object.prototype, 'hasOwnProperty', { 'delete': true }));
|
---|
| 13 |
|
---|
| 14 | t.equal(inspect(arr), '[ 1, , 3 ]');
|
---|
| 15 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.