-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: second level parameter parse + tests
- Loading branch information
1 parent
300cbeb
commit 35e34ae
Showing
4 changed files
with
432 additions
and
4 deletions.
There are no files selected for viewing
347 changes: 347 additions & 0 deletions
347
core/instrument/src/__snapshots__/get-csf-stories.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,347 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Extract CSF stories No parameters 1`] = ` | ||
Object { | ||
"myStory": Object { | ||
"parameters": Array [], | ||
"source": Object { | ||
"end": Object { | ||
"column": 37, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 35, | ||
"line": 2, | ||
}, | ||
}, | ||
}, | ||
} | ||
`; | ||
|
||
exports[`Extract CSF stories Props parameters 1`] = ` | ||
Object { | ||
"myStory": Object { | ||
"parameters": Array [ | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 34, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 29, | ||
"line": 2, | ||
}, | ||
}, | ||
"name": "props", | ||
"value": "props", | ||
}, | ||
], | ||
"source": Object { | ||
"end": Object { | ||
"column": 40, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 38, | ||
"line": 2, | ||
}, | ||
}, | ||
}, | ||
} | ||
`; | ||
|
||
exports[`Extract CSF stories Three levels - alias 1`] = ` | ||
Object { | ||
"myStory": Object { | ||
"parameters": Array [ | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 60, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 30, | ||
"line": 2, | ||
}, | ||
}, | ||
"name": undefined, | ||
"value": Array [ | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 53, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 38, | ||
"line": 2, | ||
}, | ||
}, | ||
"name": "name", | ||
"value": Array [ | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 45, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 40, | ||
"line": 2, | ||
}, | ||
}, | ||
"name": "first", | ||
"value": "first", | ||
}, | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 51, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 47, | ||
"line": 2, | ||
}, | ||
}, | ||
"name": "last", | ||
"value": "last", | ||
}, | ||
], | ||
}, | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 58, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 55, | ||
"line": 2, | ||
}, | ||
}, | ||
"name": "age", | ||
"value": "age", | ||
}, | ||
], | ||
}, | ||
], | ||
"source": Object { | ||
"end": Object { | ||
"column": 67, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 65, | ||
"line": 2, | ||
}, | ||
}, | ||
}, | ||
} | ||
`; | ||
|
||
exports[`Extract CSF stories Two levels - alias 1`] = ` | ||
Object { | ||
"myStory": Object { | ||
"parameters": Array [ | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 50, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 30, | ||
"line": 2, | ||
}, | ||
}, | ||
"name": undefined, | ||
"value": Array [ | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 43, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 38, | ||
"line": 2, | ||
}, | ||
}, | ||
"name": "name", | ||
"value": "MyNam", | ||
}, | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 48, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 45, | ||
"line": 2, | ||
}, | ||
}, | ||
"name": "age", | ||
"value": "age", | ||
}, | ||
], | ||
}, | ||
], | ||
"source": Object { | ||
"end": Object { | ||
"column": 57, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 55, | ||
"line": 2, | ||
}, | ||
}, | ||
}, | ||
} | ||
`; | ||
|
||
exports[`Extract CSF stories Two levels sub parameters 1`] = ` | ||
Object { | ||
"myStory": Object { | ||
"parameters": Array [ | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 43, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 30, | ||
"line": 2, | ||
}, | ||
}, | ||
"name": undefined, | ||
"value": Array [ | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 36, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 32, | ||
"line": 2, | ||
}, | ||
}, | ||
"name": "name", | ||
"value": "name", | ||
}, | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 41, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 38, | ||
"line": 2, | ||
}, | ||
}, | ||
"name": "age", | ||
"value": "age", | ||
}, | ||
], | ||
}, | ||
], | ||
"source": Object { | ||
"end": Object { | ||
"column": 50, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 48, | ||
"line": 2, | ||
}, | ||
}, | ||
}, | ||
} | ||
`; | ||
|
||
exports[`Extract CSF stories Two parameters 1`] = ` | ||
Object { | ||
"myStory": Object { | ||
"parameters": Array [ | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 35, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 30, | ||
"line": 2, | ||
}, | ||
}, | ||
"name": "props", | ||
"value": "props", | ||
}, | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 44, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 37, | ||
"line": 2, | ||
}, | ||
}, | ||
"name": "context", | ||
"value": "context", | ||
}, | ||
], | ||
"source": Object { | ||
"end": Object { | ||
"column": 51, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 49, | ||
"line": 2, | ||
}, | ||
}, | ||
}, | ||
} | ||
`; | ||
|
||
exports[`Extract CSF stories Typescript 1`] = ` | ||
Object { | ||
"myStory": Object { | ||
"parameters": Array [ | ||
Object { | ||
"loc": Object { | ||
"end": Object { | ||
"column": 47, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 30, | ||
"line": 2, | ||
}, | ||
}, | ||
"name": "props", | ||
"value": "props", | ||
}, | ||
], | ||
"source": Object { | ||
"end": Object { | ||
"column": 54, | ||
"line": 2, | ||
}, | ||
"start": Object { | ||
"column": 52, | ||
"line": 2, | ||
}, | ||
}, | ||
}, | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.