bahttext 2.1.1 → 2.1.2
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/README-en.md +8 -0
- package/README.md +8 -0
- package/package.json +5 -1
- package/src/index.test.js +8 -0
- package/stryker.conf.json +25 -0
package/README-en.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|

|
|
10
10
|

|
|
11
11
|

|
|
12
|
+
[](https://dashboard.stryker-mutator.io/reports/github.com/jojoee/bahttext/master)
|
|
12
13
|
|
|
13
14
|
Language: [ไทย](https://github.com/jojoee/bahttext/blob/master/README.md), [English](https://github.com/jojoee/bahttext/blob/master/README-en.md)
|
|
14
15
|
|
|
@@ -89,6 +90,13 @@ csvtojson ./misc/testcases.csv | jq > ./misc/testcases.json
|
|
|
89
90
|
# to update dependency version
|
|
90
91
|
npm update --save
|
|
91
92
|
npm audit fix --force
|
|
93
|
+
|
|
94
|
+
# mutation test
|
|
95
|
+
npm install -g stryker-cli
|
|
96
|
+
stryker init
|
|
97
|
+
export STRYKER_DASHBOARD_API_KEY=<the_project_api_token>
|
|
98
|
+
echo $STRYKER_DASHBOARD_API_KEY
|
|
99
|
+
npx stryker run
|
|
92
100
|
```
|
|
93
101
|
|
|
94
102
|
## Reference
|
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|

|
|
9
9
|

|
|
10
10
|

|
|
11
|
+
[](https://dashboard.stryker-mutator.io/reports/github.com/jojoee/bahttext/master)
|
|
11
12
|
|
|
12
13
|
ภาษา: [ไทย](https://github.com/jojoee/bahttext/blob/master/README.md), [English](https://github.com/jojoee/bahttext/blob/master/README-en.md)
|
|
13
14
|
|
|
@@ -88,6 +89,13 @@ csvtojson ./misc/testcases.csv | jq > ./misc/testcases.json
|
|
|
88
89
|
# to update dependency version
|
|
89
90
|
npm update --save
|
|
90
91
|
npm audit fix --force
|
|
92
|
+
|
|
93
|
+
# mutation test
|
|
94
|
+
npm install -g stryker-cli
|
|
95
|
+
stryker init
|
|
96
|
+
export STRYKER_DASHBOARD_API_KEY=<the_project_api_token>
|
|
97
|
+
echo $STRYKER_DASHBOARD_API_KEY
|
|
98
|
+
npx stryker run
|
|
91
99
|
```
|
|
92
100
|
|
|
93
101
|
## อ้างอิง
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bahttext",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Change number to Thai pronunciation string",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"typings": "src/index.js",
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
"semantic-release": "semantic-release",
|
|
12
12
|
"standard": "standard",
|
|
13
13
|
"standard.fix": "standard --fix",
|
|
14
|
+
"test": "jest",
|
|
15
|
+
"test.watch": "jest --watch",
|
|
14
16
|
"validate": "npm run standard && npm run coverage.check"
|
|
15
17
|
},
|
|
16
18
|
"repository": {
|
|
@@ -32,6 +34,8 @@
|
|
|
32
34
|
},
|
|
33
35
|
"homepage": "https://github.com/jojoee/bahttext#readme",
|
|
34
36
|
"devDependencies": {
|
|
37
|
+
"@stryker-mutator/core": "^6.3.1",
|
|
38
|
+
"@stryker-mutator/jest-runner": "^6.3.1",
|
|
35
39
|
"jest": "^26.6.3",
|
|
36
40
|
"jest-expect-message": "^1.0.2",
|
|
37
41
|
"semantic-release": "^19.0.5",
|
package/src/index.test.js
CHANGED
|
@@ -67,6 +67,14 @@ describe('bahttext', () => {
|
|
|
67
67
|
expect(bahttext(undefined)).toBe(zeroText)
|
|
68
68
|
expect(bahttext('this-is-not-number')).toBe(zeroText)
|
|
69
69
|
expect(bahttext('it-must-be-number-only')).toBe(zeroText)
|
|
70
|
+
expect(bahttext('a123')).toBe(zeroText)
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
test('leading with zero', () => {
|
|
74
|
+
expect(bahttext('0.1')).toBe('สิบสตางค์')
|
|
75
|
+
expect(bahttext('01.1')).toBe('หนึ่งบาทสิบสตางค์')
|
|
76
|
+
expect(bahttext('-01.1')).toBe('ลบหนึ่งบาทสิบสตางค์')
|
|
77
|
+
expect(bahttext('000.01')).toBe('หนึ่งสตางค์')
|
|
70
78
|
})
|
|
71
79
|
|
|
72
80
|
test('less than Number.MIN_SAFE_INTEGER', () => {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@stryker-mutator/core/schema/stryker-schema.json",
|
|
3
|
+
"_comment": "This config was generated using 'stryker init'. Please take a look at: https://stryker-mutator.io/docs/stryker-js/configuration/ for more information.",
|
|
4
|
+
"packageManager": "npm",
|
|
5
|
+
"reporters": [
|
|
6
|
+
"json",
|
|
7
|
+
"progress",
|
|
8
|
+
"html",
|
|
9
|
+
"dashboard"
|
|
10
|
+
],
|
|
11
|
+
"testRunner": "jest",
|
|
12
|
+
"testRunner_comment": "Take a look at https://stryker-mutator.io/docs/stryker-js/jest-runner for information about the jest plugin.",
|
|
13
|
+
"thresholds": {
|
|
14
|
+
"high": 85,
|
|
15
|
+
"low": 80,
|
|
16
|
+
"break": 75
|
|
17
|
+
},
|
|
18
|
+
"dashboard": {
|
|
19
|
+
"project": "github.com/jojoee/bahttext",
|
|
20
|
+
"version": "master",
|
|
21
|
+
"baseUrl": "https://dashboard.stryker-mutator.io/api/reports",
|
|
22
|
+
"reportType": "full"
|
|
23
|
+
},
|
|
24
|
+
"coverageAnalysis": "perTest"
|
|
25
|
+
}
|