Commit Graph
120 Commits
Author SHA1 Message Date
fisker Cheung 1005954c75 Test: use errors options instead of disableBabelTS (#9387) 2020-10-13 17:16:40 +08:00
fisker CheungandChris Brody 73e3976c34 Add espree parser (#9000)
Co-authored-by: Chris Brody <chris.brody+brodybits@gmail.com>
2020-10-13 09:14:02 +08:00
fisker Cheung 203be9da5a Change test package name (#8848) 2020-09-18 14:05:29 +08:00
fisker Cheung 47ed40d970 Enable CR test (#9148)
* Enable `CR` test

* Fix tests

* Ignore `standalone.js`
2020-09-17 07:35:33 +08:00
fisker Cheung 94ef5f5683 Test: Fix indexes calculation (#9152)
* Test: Fix indexes calculation

* Simplify logic

* Update snapshots
2020-09-17 07:31:29 +08:00
fisker Cheung 370844cc4c Run full test on every parser (#9070)
* Refactor test

* Fix

* Improve `hasPragma` & `insertPragma` on files has BOM

* Fix `coreFormat` cursorOffset

* Code style

* Update snapshots

* Refactor

* Restore BOM test

* Add export

* Empty file

* return after SyntaxError

* EOL test

* Fix eol tests

* Named export

* Tweak matrix

* Disable on `requirePragma`

* Disable `cr` test

* Simplify logic

* Update `verbose`

* Remove `test:full-test`

* Typo
2020-09-04 23:43:41 +08:00
fisker Cheung fadd93571d Turn test setup file to lazy load (#9080) 2020-08-28 10:02:08 +08:00
fisker Cheungandprettifier[bot] ee57066cb4 HTML: Fix format on style[lang="sass"] (#9051)
Co-authored-by: prettifier[bot] <45367598+prettifier[bot]@users.noreply.github.com>
2020-08-26 00:26:03 +08:00
fisker Cheung 08e8b40ac6 Move non-js syntax test out of tests/js/ dir (#9023) 2020-08-22 14:50:54 +08:00
fisker Cheung d1a9d7420b Run AST_COMPARE test for verifyParsers too (#8966) 2020-08-19 21:26:33 +08:00
fisker Cheung 69d26582e7 Refactor test (#8940) 2020-08-10 22:17:51 +08:00
fisker Cheung 0a2ec1b4a2 Fix range tests with TEST_CRLF and endOfLine option (#8821) 2020-08-08 16:45:44 +08:00
fisker Cheung 0c2b918078 ESLint: enable import/order (#8635) 2020-06-26 20:30:21 +08:00
b27f84438d Update remark parse v8 (#8140)
* Update `remark-parse` to v7

* fix `link` title and  `inlineCode`

* fix `code` meta

* fix code meta

* fix ListItem print

* fix heading print result

* remove blank line before childList

* trim `inlineCode` ast

* use List.spread

* use ListItem.spread

* fix `example-550.md` snap

* update `example-522.md` snap

* update `example-508.md` snap

* update `example-509.md` snap

* update `example-222.md` snap

* Update listitem print

* lower case definition.label to match ast

* trim definition.label to match ast

* trim definition.label to match ast

* unescape Link.title

* filter link with no title

* fix link title

* fix link title

* restore preprocess

* fix ast massage

* Restore list

* Update to remark-parse 8.0.2

* Update snapshot tests after rebase

* Create legacy `loose` attribute from `spread`

Uses @duailibe's suggestion from here:
https://github.com/prettier/prettier/issues/6180#issuecomment-499498432

Also backtracks some other unnecessary changes.

* Update test case for shortcut reference-style links

The commonmark spec does not allow for whitespace between the left and right
parts of a full reference-style link.

https://spec.commonmark.org/dingus/?text=%5Bfoo%5D%20%5Bbar%5D%0A%0A%5Bbar%5D%3A%20%2Furl%20%22title%22%0A

Notice that the `[foo]` is parsed as plain text, while the `[bar]` is parsed
as a shortcut reference link.

When there is a space between the two, each part is parsed as a separate
shortcut style reference link node:

https://astexplorer.net/#/gist/d69f5a227e2cbde3f43f0a639bee165c/822b531c252c162faba78e38607db73ef72886d5

Previously they would have been parsed as a single full reference link.

Here I update the test-case to account for the shortcut style links.

* Add remark-footnotes plugin to replace legacy footnotes option

Remark removed the footnotes option in favor of a new remark-footnotes
plugin in https://github.com/remarkjs/remark/pull/483

Here I've simply switched to use the plugin instead of the removed
option and updated the snapshot tests.

* Add test case for #4369

* Do not add gap if has leading space

* Restore `inlineCode` ast compare

* Restore `isPrevNodeLooseListItem`

* Ignore some ast property

* Restore blank line, Fix `isPrevNodeLooseListItem` check

* Title compare

* Ignore `loose`

* Fix footnoteDefinition

* Fix tabWidth

* Style

* `footnoteDefinition` is stable now

* Fix `_` after link

* Revert workaround, url tests

* Fix idempotence issue with underscores and autolinks

* Fix idempotence issue with underscores and autolinks - attempt # 2

* Fix idempotence issue with underscores and autolinks - attempt # 3

* Fix idempotence issue with underscores and autolinks - part # 4

* More tests

* Code style

* Only test master passed tests

* Update list

* Update list

* Use code as test name

* Fix idempotence issue with underscores and autolinks - part # 5

* Fix idempotence issue with underscores and autolinks - part # 6

* Linting fix

* More autolink tests

* Fix tests

* Rename to `auto-link`

* More tests

* Disable new cases

* tests for issue 4122

* add changelog

Co-authored-by: fisker <lionkay@gmail.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-06-23 13:52:50 +03:00
Georgii Dolzhykov 3094ad5aa2 Fix unstable comments in binary expressions (#8491) 2020-06-05 09:55:22 +03:00
fisker Cheung 413f1a5db5 Test: extract code to utils (#8433) 2020-05-28 09:29:21 +08:00
fisker Cheung 12d379d29d Test: visualize the range (#8420) 2020-05-28 01:16:52 +08:00
Georgii Dolzhykov d420202df4 fix(js): comments after superclass (#8312)
* Fix comments after superclass

* add changelog

* refactor

* Organize tests

* Use addBlockStatementFirstComment

* Amend unstableTests list

* Avoid identical comments in tests

* Add tests for `implements`

* Handle comments in interfaces

* Remove an always-false condition

* Almost a fix

* Further fixes

* Add DeclareClass

* Add DeclareInterface, mixins

* Fix extends in DeclareClass

* Fix DeclareClass

* Fix mixins

* Refactor: remove unused parameters

* Add marked dangling comments

* Unify printing of interface for TS and Flow

* Fix unstable interfaces

* Remove comment

* Restore the original behavior for interfaces with multiple inheritance

* Refactoring, tests

* Remove unused code

* Include a file accidentally omitted from the merge commit

* Remove unused type import
2020-05-24 21:53:29 +03:00
fisker Cheung 243a06f073 Test: correct file extensions (#8362) 2020-05-21 21:10:00 +08:00
fisker Cheung 8ebda75fec Fix unstable yaml print (#8355) 2020-05-21 19:04:06 +08:00
fisker Cheung d47a225d06 Test: "Expected" and "Received" are mixed up in ast compare (#8305) 2020-05-14 19:29:32 +03:00
fisker Cheung ed3eeb82f8 Test: add parser check (#8256) 2020-05-08 10:56:09 +08:00
fisker Cheung 7ad515111e Categorize tests part 4(CSS, flow, misc) (#8251) 2020-05-08 01:29:34 +08:00
fisker Cheung b622578896 Categorize tests part 3 (js) (#8249)
* Categorize tests(js)
2020-05-08 00:55:46 +08:00
fisker Cheung f8c5b1fd1d Categorize tests part 2 (#8248)
* Categorize tests (yaml, markdown)

* Categorize tests (handlebars)

* Categorize tests (graphql)

* Categorize tests (typescript)

* Categorize tests (json)

* Categorize tests (jsx)
2020-05-07 23:54:44 +08:00
fisker Cheung b585bd6fa4 Categorize tests (html) (#8239) 2020-05-07 23:05:21 +08:00
Masashi HiranoandGeorgii Dolzhykov 3b78c021d1 JS: Keep the position of end-of-line comments in binary expressions (#7787)
* JS: block comments with LogicalExpression

* Add changelog_unreleased for #7787

* Add handleBinaryExpression in comments.js

* Refactor comments.js to use isBlockComment

* Update pr-7787.md

* Update pr-7787.md

* test: regenerate snapshot for comments/logical-expression

* test: logical-expression.js as unstable tests

* test: add comments/binary-expressions-trailing-space.js

* fix: make two functions one 'handleEndOfLineBlockComments'

* Rename handleEndOfLineBlockComments to handleBinaryExpression

* Refactor handleBinaryExpression to remove unneed condition & params

* Divide and rename test files for handleBinaryExpression()

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-05-07 16:05:27 +03:00
fisker Cheung f470142e16 test: Allow assert output (#8142)
* test: Allow assert output

* Use `outdent`
2020-04-25 09:23:34 +08:00
fisker CheungandGeorgii Dolzhykov 3a373074bc Run tests on snippets instead of files (#8088)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-04-21 15:57:58 +08:00
fisker Cheung be56c725c0 Show options in test title (#7785)
* Show options in test title

* Update snapshots
2020-04-18 16:09:07 +03:00
fisker Cheung a522b1e556 Add ability to test errors (#8025) 2020-04-14 18:19:13 +08:00
fisker Cheung eca28c70c6 Fix graphql comments between interfaces (#8006) 2020-04-10 21:09:54 +08:00
fisker Cheung 7e8b6b7617 Skip DEEP_COMPARE test if code didn't change (#7982)
* Skip `DEEP_COMPARE` if code didn't change

* Check stable
2020-04-10 20:07:07 +08:00
fisker CheungandGeorgii Dolzhykov aa3141c24e Wrap tests in describe (#7934)
* Run `format()` in test function

* Wrap `test`s in `describe`

* Update tests_config/run_spec.js

Co-Authored-By: Georgii Dolzhykov <thorn.mailbox@gmail.com>

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-04-10 19:12:01 +08:00
fisker Cheung 0c1b737cde Skip AST_COMPARE test if code didn't change (#7800)
* Skip `AST_COMPARE` test if code didn't change

* use basename

* Use `test.skip`

* Code style
2020-04-07 14:38:25 +03:00
fisker Cheung bcf99ade8d Fix angular unstable expression binding (#7924) 2020-04-02 20:20:28 +03:00
fisker Cheung 93aa37867e Update isSCSS test regex (#7922) 2020-04-02 15:51:48 +03:00
fisker Cheung 22e3004719 Fix empty file format (#7921) 2020-04-02 00:43:52 +03:00
fisker Cheung b0ffc0f1df Fix prettier-ignore inside JSX (#7877) 2020-03-26 20:10:05 +02:00
fisker Cheung 77e3fc0d41 Fix ignored element print (#7867)
* Fix ignored element print

* Add changelog
2020-03-25 15:54:39 +03:00
fisker Cheung b9b5a66f40 Tweak CI configs (#7860)
* Only run on `master` push

* Test `CRLF` on windows
2020-03-24 17:09:16 +02:00
Georgii Dolzhykov 9dad95b35f Bump Prettier dependency to 2.0.0 2020-03-21 22:09:54 +02:00
fisker Cheung 71b2d35d59 Test second format (#7565) 2020-03-21 13:43:01 +02:00
fisker Cheung c82ce657e3 Run verify test on disabled babel-ts tests (#7786) 2020-03-18 15:35:13 +02:00
fisker Cheung ee1a8e45f4 Always enable ENABLE_TEST_RESULTS and AST_COMPARE on CI (#7433)
* Use `ci-info` instead of `is-ci`

* Always enable `ENABLE_TEST_RESULTS` and `AST_COMPARE` on CI
2020-02-14 12:30:58 +02:00
fisker Cheung e2e534df30 Remove normalize-path package (#7465)
* Remove `normalize-path` module

* Try run all tests on `standalone`

* Restore test

* Add `no-parser-tests`

* Fix issue with shim

* DRY

* Rename tests

* Use `endsWith`
2020-02-03 01:33:19 +02:00
JounQinandGeorgii Dolzhykov c1937cb1b8 feat: add new parser babel-ts to parse TypeScript syntaxes via Babel (#6400)
* feat: add new parser `babel-ts` to parse TypeScript syntaxes via Babel

* docs: document parser babel-ts

* chore: enable babel-ts in markdown and worker.js

* verify all TS tests against babel-ts except disabled by disableBabelTS

* support for TSDeclareMethod; fix abstract properties and methods

* fix embedded angular templates and styles

* fix TSImportType

* simplify babel options combinations

* fix method decorators

* fix ranges

* work around loc inconsistencies for SequenceExpression

* don't print trailing comma in type parameters (unsupported in TS < 3.3)

* preserve quotes for class properties

* align printing of single-parameter functions

* fix comments in degenerate single-element unions and intersections

* fix comments for methods

* fix comments for mapped types

* edit docs, change 'since' to 2.0.0

* add changelog

* fix code sample on playground

* update snapshots after rebase

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-01-29 14:11:16 +02:00
Masashi Hirano bc31b13b9c Upgrade Node.js version and drop mkdirp (#7302) 2020-01-21 13:00:37 +03:00
fisker Cheung 00d46ee26e Fix prefer-object-spread in /tests* (#7337) 2020-01-19 01:23:16 +02:00
fisker CheungandGeorgii Dolzhykov d456b158e0 Style: use object destructuring (#7325)
* Style: use object destructuring

* Update versions.js

* Update sync-flow-tests.js

* Update core.js

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-01-14 17:30:18 +02:00