Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
fed959f
[RFC] Inline Snapshots
azz Jun 2, 2018
c639484
Fix typechecking and refactor
azz Jun 2, 2018
396b20b
Refactor State#match
azz Jun 2, 2018
2816e7d
Fix stacktrace regression
azz Jun 2, 2018
a215e16
Remove unused argument
azz Jun 2, 2018
8c821a1
Fix support for property matchers
azz Jun 2, 2018
bbe79ba
Fix tests after State#match refactor
azz Jun 2, 2018
d5d349b
Fix toThrowErrorMatchingInlineSnapshot
azz Jun 2, 2018
190df70
Optimize snapshot lookup
azz Jun 3, 2018
05f94df
Support flow parser
azz Jun 3, 2018
eb6d86d
Relax prettier version requirement
azz Jun 3, 2018
14b8b90
Fix TypeScript support
azz Jun 3, 2018
af1696e
Support toMatchInlineSnapshot from external files
azz Jun 3, 2018
91e3482
Add tests for saveInlineSnapshots()
azz Jun 3, 2018
8334b6f
Fix InlineSnapshot type definition
azz Jun 3, 2018
80f75ee
Escape backtick strings
azz Jun 5, 2018
b3f462d
Add test for escaping backticks
azz Jun 6, 2018
8ed6096
Code review fixes
azz Jun 7, 2018
c07788a
Support project option for prettier
azz Jun 9, 2018
657f10e
Refactor configuration
azz Jun 9, 2018
97c054a
Fix typechecking
azz Jun 9, 2018
6537c33
Set default value in cli/options
azz Jun 9, 2018
51c42ef
Fix typechecking
azz Jun 9, 2018
cc0bcdd
Write E2E tests for toMatchInlineSnapshot
azz Jun 9, 2018
58e6f59
Fix bad copy/paste
azz Jun 9, 2018
e1ffa94
Parameterize saveInlineSnapshots test with jest-each
azz Jun 10, 2018
408bad4
Write E2E tests for toThrowErrorMatchingInlineSnapshot
azz Jun 10, 2018
3f6531b
Write more aync tests
azz Jun 10, 2018
8c9a441
Skip currently failing test
azz Jun 10, 2018
52740e1
Remove unused testPath property from State
azz Jun 10, 2018
dcbaec8
Write documentation
azz Jun 10, 2018
436cd7f
Support async matchers
azz Jun 12, 2018
f653fdf
Fix links in docs
azz Jun 12, 2018
5f89615
Merge branch 'master' into jest-inline-snapshots
azz Jun 27, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unused argument
  • Loading branch information
azz committed Jun 11, 2018
commit a215e169370860847dd128a84ba574bb58f4757c
7 changes: 2 additions & 5 deletions packages/jest-message-util/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,7 @@ export const getStackTraceLines = (
return removeInternalStackEntries(stack.split(/\n/), options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you get rid of the braces and return? :P

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could add https://eslint.org/docs/rules/arrow-body-style (which is autofixable)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

};

export const getTopFrame = (
lines: string[],
options: StackTraceOptions = {noStackTrace: false},
) => {
export const getTopFrame = (lines: string[]) => {
for (const line of lines) {
if (line.includes(PATH_NODE_MODULES) || line.includes(PATH_JEST_PACKAGES)) {
continue;
Expand All @@ -257,7 +254,7 @@ export const formatStackTrace = (
testPath: ?Path,
) => {
const lines = getStackTraceLines(stack, options);
const topFrame = getTopFrame(lines, options);
const topFrame = getTopFrame(lines);
let renderedCallsite = '';
const relativeTestPath = testPath
? slash(path.relative(config.rootDir, testPath))
Expand Down