main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
794 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var test = require('tape');
|
---|
4 |
|
---|
5 | var $Object = require('../');
|
---|
6 | var ToObject = require('..//ToObject');
|
---|
7 | var RequireObjectCoercible = require('..//RequireObjectCoercible');
|
---|
8 |
|
---|
9 | test('errors', function (t) {
|
---|
10 | t.equal($Object, Object);
|
---|
11 | // @ts-expect-error
|
---|
12 | t['throws'](function () { ToObject(null); }, TypeError);
|
---|
13 | // @ts-expect-error
|
---|
14 | t['throws'](function () { ToObject(undefined); }, TypeError);
|
---|
15 | // @ts-expect-error
|
---|
16 | t['throws'](function () { RequireObjectCoercible(null); }, TypeError);
|
---|
17 | // @ts-expect-error
|
---|
18 | t['throws'](function () { RequireObjectCoercible(undefined); }, TypeError);
|
---|
19 |
|
---|
20 | t.deepEqual(RequireObjectCoercible(true), true);
|
---|
21 | t.deepEqual(ToObject(true), Object(true));
|
---|
22 |
|
---|
23 | var obj = {};
|
---|
24 | t.equal(RequireObjectCoercible(obj), obj);
|
---|
25 | t.equal(ToObject(obj), obj);
|
---|
26 |
|
---|
27 | t.end();
|
---|
28 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.