forked from tholian-network/stealth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
String.mjs
60 lines (34 loc) · 1.35 KB
/
String.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { describe, finish } from '../../covert/index.mjs';
import { String, isString } from '../source/String.mjs';
describe('String.isString()', function(assert) {
let string1 = 'example.com';
let string2 = new String('example.com');
assert(typeof String.isString, 'function');
assert(String.isString, isString);
assert(String.isString(string1), true);
assert(String.isString(string2), true);
});
describe('isString()', function(assert) {
let string1 = 'example.com';
let string2 = new String('example.com');
assert(typeof isString, 'function');
assert(isString(string1), true);
assert(isString(string2), true);
});
describe('String.prototype.toString()', function(assert) {
let string1 = 'example.com';
let string2 = new String('example.com');
assert(Object.prototype.toString.call(string1), '[object String]');
assert(Object.prototype.toString.call(string2), '[object String]');
assert((string1).toString(), 'example.com');
assert((string2).toString(), 'example.com');
});
describe('String.prototype.valueOf()', function(assert) {
let string1 = 'example.com';
let string2 = new String('example.com');
assert((string1).valueOf(), 'example.com');
assert((string2).valueOf(), 'example.com');
assert(JSON.stringify(string1), '"example.com"');
assert(JSON.stringify(string2), '"example.com"');
});
export default finish('base/String');