Commit Graph

12 Commits (f207e665bc5af4c95f361d65387638c33521c492)

Author SHA1 Message Date
Sosuke Suzuki f207e665bc JavaScript: Break arrays of arrays/objects if each element has more than one element/property (#6694)
* Modify to define isJestEachFunctionCall

* Modify to break ArrayExpression when parent is jest each function

* Add tests

* Update CHANGELOG.unreleased.md

* Fix comment

* Add pr number

* Update CHANGELOG.unreleased.md

* Remove hasNewLineInRange

* Modify to change logic for breaking jest each call function

* Modify to add logic for breaking ArrayExpression

* Modify to avoid mixed nested array

* Modify to remove changes for jest

* Update CHANGELOG.unreleased.md

* Update CHANGELOG.unreleased.md
2019-10-25 19:12:07 +03:00
Ika 4af3dd4b07
test: improve snapshots (#5521)
- before
  ```
  ${input}${"~".repeat(printWidth)}
  ${output}
  ```
- after
  ```
  ===options===
  ${options}
  ${" ".repeat(printWidth)}| printWidth
  ====input====
  ${input}
  ===output====
  ${output}
  =============
  ```
2018-11-25 16:21:14 +08:00
Simen Bekkhus 51b7c02e12 Upgrade jest to 22 (#4782)
* chore: upgrade Jest

* chore: update snapshots

* chore: lock down babel dependency using invalid syntax

* 2 args to test.skip

* use jest 22 for now

* Revert "2 args to test.skip"

This reverts commit 691fdc3f99e320f2303958f2b503f7b4c93fa455.

* remove snapshot name from matcher

* fix standalone tests skips
2018-07-03 03:06:29 -03:00
Jan Kassens b82220b20f Prittier printing of snapshots (#1190)
This uses a custom snapshot serializer to reduce escaping in snapshot files and
make them easier to read.

Snapshot serializers are documented here:
https://facebook.github.io/jest/docs/configuration.html#snapshotserializers-array-string
2017-04-12 13:41:51 -07:00
Christopher Chedeau c3199359b0 Revert "Improve snapshot naming" (#1070)
* Revert "Remove mutation in `printBinaryishExpressions` (#1067)"

This reverts commit e7312ad7b2.

* Revert "Make it clear what parser was used in each snapshot (#1068)"

This reverts commit 4f7ae4815b.
2017-03-21 17:38:28 -07:00
ChristianHersevoort 4f7ae4815b Make it clear what parser was used in each snapshot (#1068) 2017-03-21 14:47:23 -07:00
Royce Townsend 9eb389b9f4 Group first arg for inline functions (#947)
* Group first arg for inline functions

* Group first arg. Unless there are comments.

* Group first arg. Allow second arg to be empty object/array.

This implementation has a side effect of disallowing empty objects/arrays in the should group last arg heuristic.
2017-03-18 11:20:07 -07:00
Rogelio Guzman d45e157563 Upgrade to Jest 19 (#762)
* Upgrade to Jest 19

* Use exact versions for Jest
2017-02-21 13:59:19 -08:00
Christopher Chedeau 8bc3c617a0 Preserve next line with trailing comment (#535)
It turns that our hasNextLine logic needs to be tuned to skip all the trailing comments. The code is not pretty but it does the job. It looks like it fixes a bunch of things in the test cases :)

I made sure that nested inline comments are NOT valid JavaScript

```js
/* /* a */ */
Uncaught SyntaxError: Unexpected token *
```

so it is okay to do a dumb search for */ when you are in a comment
2017-01-31 11:27:44 -05:00
Christopher Chedeau 956779ec17 Preserve empty line after comment (#493)
The logic was already working, it was just special-cased to the first comment of the file! Presumably because the new line detection logic used to be broken ;)

I manually checked the first 10 snapshots and they are all legit, so I assume that all of them are.

Fixes #356
2017-01-27 14:05:41 -05:00
James Long eaddd4b3e6 Refactor comment algorithm and improve newline/spaces detection (fixes #483, #275, #135, #78, #36) (#482) 2017-01-26 11:57:43 -08:00
Christopher Chedeau 3375cfe605 Move tests around (#454)
* new_tests

* move_all_clobbered_tests

* remove all the tests that no longer exist

* re-run flow tests

* Move all the flow tests to tests/flow and prettier to tests/

* Move prettier tests to their own folders

* Add jsfmt files

* run prettier snapshot tests
2017-01-24 14:35:37 -08:00