.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / x-is-string / test / index.js
1 var test = require("tape")
2
3 var isString = require("../index")
4
5 test("isString is a function", function (assert) {
6     assert.equal(typeof isString, "function")
7     assert.end()
8 })
9
10 test("string literal is truthy", function (assert) {
11     assert.equal(isString("hello"), true)
12     assert.end()
13 })
14
15 test("empty string is truthy", function (assert) {
16     assert.equal(isString(""), true)
17     assert.end()
18 })
19
20 test("string object is truthy", function (assert) {
21     assert.equal(isString(new String("hello")), true)
22     assert.end()
23 })
24
25 test("number is falsey", function (assert) {
26     assert.equal(isString(9), false)
27     assert.end()
28 })
29
30 test("boolean is falsey", function (assert) {
31     assert.equal(isString(true), false)
32     assert.end()
33 })
34
35 test("date is falsey", function (assert) {
36     assert.equal(isString(new Date()), false)
37     assert.end()
38 })
39
40 test("object is falsey", function (assert) {
41     assert.equal(isString({}), false)
42     assert.end()
43 })
44 test("null is falsey", function (assert) {
45     assert.equal(isString(null), false)
46     assert.end()
47 })
48 test("undefined is falsey", function (assert) {
49     assert.equal(isString(undefined), false)
50     assert.end()
51 })