Skip to content

Commit 15fbc9a

Browse files
committed
add(test): added test for and/or malfunction bug
1 parent 301ef91 commit 15fbc9a

File tree

7 files changed

+27
-41
lines changed

7 files changed

+27
-41
lines changed

commitlint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = {
1515
'compiler',
1616
'jslang',
1717
'rules',
18-
'tests',
18+
'test',
1919
'skeleton',
2020
'doc',
2121
'lint',

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"description": "An easy and powerful data validation code generator by JavaScript.",
55
"main": "lib/index.js",
66
"scripts": {
7-
"prepare": "npm run rebuild",
7+
"prepublishOnly": "npm run rebuild && npm run test",
88
"build": "tsc -v && tsc -p .",
99
"build-watch": "tsc -v && tsc -w -p .",
1010
"build-amd": "tsc -p tsconfig-amd.json",
1111
"build-systemjs": "tsc -p tsconfig-systemjs.json",
12-
"build-all": "npm run build & npm run build-amd & npm run build-systemjs",
12+
"build-all": "npm run build && npm run build-amd && npm run build-systemjs",
1313
"rebuild": "npm run clean && npm run lint && npm run build-all",
1414
"test": "mocha",
1515
"clean": "rm -rf lib examples test dist",

src/test/09-exceptions.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,27 @@ const testItems: ITestSuite = {
4040
}
4141
]
4242
},
43+
{
44+
'name': JSON.stringify({ 'test': 'int8' }),
45+
'rule': { 'test': 'int8' },
46+
'items': [
47+
{
48+
inputName: 'When test === 123',
49+
inputValue: {'test': 123},
50+
expect: true
51+
},
52+
{
53+
inputName: 'When test === 1234',
54+
inputValue: {'test': 1234},
55+
expect: false
56+
},
57+
{
58+
inputName: 'When test is omitted',
59+
inputValue: {},
60+
expect: false
61+
}
62+
]
63+
},
4364
]
4465
};
4566

tsconfig-amd.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
/* Basic Options */
4-
"target": "es2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
4+
"target": "es2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
55
"module": "amd", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */
66
// "lib": [], /* Specify library files to be included in the compilation: */
77
// "allowJs": true, /* Allow javascript files to be compiled. */

tsconfig-systemjs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
/* Basic Options */
4-
"target": "es2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
4+
"target": "es2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
55
"module": "system", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */
66
// "lib": [], /* Specify library files to be included in the compilation: */
77
// "allowJs": true, /* Allow javascript files to be compiled. */

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
/* Basic Options */
4-
"target": "es2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
4+
"target": "es2016", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
55
"module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */
66
// "lib": [], /* Specify library files to be included in the compilation: */
77
// "allowJs": true, /* Allow javascript files to be compiled. */

tslint.json

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)