numberstring 0.1.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/test/test.js DELETED
@@ -1,123 +0,0 @@
1
- /*
2
- /## /"" /""
3
- | ## | "" |__/
4
- /####### /## /## /######/#### | ####### /###### /###### /""""""" /"""""" /"""""" /"" /""""""" /""""""
5
- | ##__ ##| ## | ##| ##_ ##_ ##| ##__ ## /##__ ## /##__ ## /""_____/|_ ""_/ /""__ ""| ""| ""__ "" /""__ ""
6
- | ## \ ##| ## | ##| ## \ ## \ ##| ## \ ##| ########| ## \__/| """""" | "" | "" \__/| ""| "" \ ""| "" \ ""
7
- | ## | ##| ## | ##| ## | ## | ##| ## | ##| ##_____/| ## \____ "" | "" /""| "" | ""| "" | ""| "" | ""
8
- | ## | ##| ######/| ## | ## | ##| #######/| #######| ## /"""""""/ | """"/| "" | ""| "" | ""| """""""
9
- |__/ |__/ \______/ |__/ |__/ |__/|_______/ \_______/|__/ |_______/ \___/ |__/ |__/|__/ |__/ \____ ""
10
- /"" \ ""
11
- | """"""/
12
- \______/
13
- */
14
-
15
- //*******************************************************************
16
-
17
- 'use strict';
18
-
19
- //*******************************************************************
20
-
21
- var chai = require('chai');
22
- var expect = chai.expect;
23
- var assert = chai.assert;
24
-
25
- //*******************************************************************
26
-
27
- var numberstring = require('../index.js');
28
-
29
- //*******************************************************************
30
-
31
- describe('numberstring', function() {
32
-
33
- it('should return string from a number', function() {
34
- expect( numberstring(1) ).to.be.a('string');
35
- });
36
-
37
- it('should not be a number', function() {
38
- expect( numberstring(1) ).to.not.be.a('number');
39
- });
40
-
41
- it('should be boolean if not a number', function() {
42
- expect( numberstring('one') ).to.be.a('boolean');
43
- });
44
-
45
- it('should be false if not a number', function() {
46
- expect( numberstring('one') ).to.be.false;
47
- });
48
-
49
- it('should be false if typeof not a number', function() {
50
- expect( numberstring(false) ).to.be.false;
51
- });
52
-
53
- it('should be smaller than maximum number', function() {
54
- expect( numberstring(Number.MAX_SAFE_INTEGER + 1) ).to.be.false;
55
- });
56
-
57
- it('should be zero if 0 ', function() {
58
- expect( numberstring(0) ).to.equal('zero');
59
- });
60
-
61
- it('should be five if 5 ', function() {
62
- expect( numberstring(5) ).to.equal('five');
63
- });
64
-
65
- it('should be fifteen if 15 ', function() {
66
- expect( numberstring(15) ).to.equal('fifteen');
67
- });
68
-
69
- it('should be fifty if 50 ', function() {
70
- expect( numberstring(50) ).to.equal('fifty');
71
- });
72
-
73
- it('should be fifty-five if 55 ', function() {
74
- expect( numberstring(55) ).to.equal('fifty-five');
75
- });
76
-
77
- it('should be five hundred if 500 ', function() {
78
- expect( numberstring(500) ).to.equal('five hundred');
79
- });
80
-
81
- it('should be five thousand if 5000 ', function() {
82
- expect( numberstring(5000) ).to.equal('five thousand');
83
- });
84
-
85
- it('should be fifty thousand if 50000 ', function() {
86
- expect( numberstring(50000) ).to.equal('fifty thousand');
87
- });
88
-
89
- it('should be five hundred thousand if 500000 ', function() {
90
- expect( numberstring(500000) ).to.equal('five hundred thousand');
91
- });
92
-
93
- it('should be five million if 5000000 ', function() {
94
- expect( numberstring(5000000) ).to.equal('five million');
95
- });
96
-
97
- it('should be five million five hundred fifty-five thousand five hundred fifty-five if 5555555 ', function() {
98
- expect( numberstring(5555555) ).to.equal('five million five hundred fifty-five thousand five hundred fifty-five');
99
- });
100
-
101
- });
102
-
103
- describe('numberstring.comma', function() {
104
-
105
- it('should return string from a number', function() {
106
- expect( numberstring.comma(1) ).to.be.a('string');
107
- });
108
-
109
- it('should not be a number', function() {
110
- expect( numberstring.comma(1) ).to.not.be.a('number');
111
- });
112
-
113
- it('should be boolean if not a number', function() {
114
- expect( numberstring.comma('one') ).to.be.a('boolean');
115
- });
116
-
117
- it('should be false if not a number', function() {
118
- expect( numberstring.comma('one') ).to.be.false;
119
- });
120
-
121
- });
122
-
123
-