Commit Graph

8 Commits (89971285e4c697705913791c1589c148dbae2dc0)

Author SHA1 Message Date
Joseph Frazier aedc6d4269 Add integration test of invalid syntax (#2160) 2017-06-16 09:10:39 +10:00
Joseph Frazier 3bbfa97152 Check exit codes in integration tests (#2148) 2017-06-15 09:56:48 +10:00
Lucas Azzola 364c38de0d Implement custom parser API (#1783)
* feat(api): add custom parser API

* test(api): add integration test for parser resolution

* chore(api): fix build after resolving conflicts

* docs(api): document custom parser API

* docs(api): fix typo

* chore(build): add parse5 to build and support yarn test --prod
2017-06-12 16:51:12 +10:00
Joseph Frazier 552ceb30e8 Allow --debug-check to work with stdin (#2013)
* Allow --debug-check to work with stdin

This makes it easier to quickly test formatting code snippets with e.g.

    pbpaste | prettier --debug-check

Before, the following would happen:

    $ pbpaste | prettier --debug-check
    stdin: TypeError: Invalid data, chunk must be a string or buffer, not undefined
        at WriteStream.Socket.write (net.js:693:11)
        at writeOutput (/Users/josephfrazier/workspace/prettier/bin/prettier.js:375:18)
        at getStdin.then.input (/Users/josephfrazier/workspace/prettier/bin/prettier.js:275:7)
        at <anonymous>
        at process._tickCallback (internal/process/next_tick.js:169:7)
    $

Now, it looks like this:

    $ pbpaste | prettier --debug-check
    (stdin)
    $

* Test that --debug-check still prints filenames

See https://github.com/prettier/prettier/pull/2013#discussion_r120499306
2017-06-06 16:10:24 -07:00
Philipp Spieß d679f235ed Also infer parser when using `--list-different` (#1997)
* Also infer parser when using `--list-different`

* Add integration tests for parser inference
2017-06-06 08:24:56 -07:00
Joseph Frazier 451f4aaad5 Add regression test for --debug-check (#1917)
See https://github.com/prettier/prettier/pull/1916
2017-06-02 15:30:39 -07:00
Joseph Frazier f6dabc0d27 Add regression test for CLI shebang preservation (#1901)
Following up on https://github.com/prettier/prettier/pull/1899
2017-06-02 13:42:44 -07:00
Michał Pierzchała 7a0df958dc Ignore node_modules when running prettier from CLI (#1683)
* Ignore node_modules by default

* Add integration test suite for --with-node-modules CLI arg

* Refactor tests to snapshots

* Disable eslint for purposely faulty files

* Fix node 4

* Fix prettier

* Gitignore only top-level node_modules
2017-05-23 14:19:04 -07:00