Skip to content
This repository was archived by the owner on Jan 1, 2023. It is now read-only.

Commit 86dc37f

Browse files
committed
✅ add test case
1 parent 24dd6a1 commit 86dc37f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
22
"name": "babel-plugin-object-to-json-parse",
3-
"version": "0.0.9",
3+
"version": "0.1.0",
44
"main": "dist/index.js",
55
"scripts": {
66
"build": "rm -rf dist/** && tsc",
7-
"example": "babel example/input.js -o example/output.js && node example/output.js",
87
"fmt": "prettier --write \"src/**/*.ts\"",
98
"lint": "eslint 'src/**/*.ts' --fix",
109
"test": "ls test/__fixtures__/**/*_out.js | xargs -L1 node && jest"

test/__fixtures__/object/valid_case.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ const var16 = { foo: 'fo\to' }
1717
const var17 = { foo: 'fo\fo' }
1818
const var18 = { foo: 'fo\ro' }
1919
const var19 = { foo: 'fo\no' }
20-
const var20 = { foo: 'fo\bo' }
20+
const var20 = { foo: 'fo\bo' }
21+
const var21 = { foo: 'fo\r\no' }

test/__fixtures__/object/valid_case_out.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ const var16 = JSON.parse('{"foo":"fo\\to"}')
1717
const var17 = JSON.parse('{"foo":"fo\\fo"}')
1818
const var18 = JSON.parse('{"foo":"fo\\ro"}')
1919
const var19 = JSON.parse('{"foo":"fo\\no"}')
20-
const var20 = JSON.parse('{"foo":"fo\\bo"}')
20+
const var20 = JSON.parse('{"foo":"fo\\bo"}')
21+
const var21 = JSON.parse('{"foo":"fo\\r\\no"}')

0 commit comments

Comments
 (0)