Commit Graph
43 Commits
Author SHA1 Message Date
Georgii Dolzhykov 23b4822e66 Disable Jest's default transformer (Babel) (#10454)
* Disable Jest's default transform (Babel)

https://jestjs.io/docs/en/next/code-transformation#defaults

Otherwise, I sometimes get this error because Babel tries to resolve Browserslist:

----
  ● plugin search should not crash when prettier isn't inside a directory › encountered a declaration exception

    ENOENT: no such file or directory, stat '/mnt/d/dev/prettier/tests_integration/mnt/d/dev/prettier/tests_integration/runPrettier.js'

      52 |   jest.spyOn(fs, "statSync").mockImplementation((filename) => {
      53 |     if (path.basename(filename) === "virtualDirectory") {
    > 54 |       return origStatSync(path.join(__dirname, __filename));
         |              ^
      55 |     }
      56 |     return origStatSync(filename);
      57 |   });

      at Object.<anonymous> (tests_integration/runPrettier.js:54:14)
      at isFile (node_modules/browserslist/node.js:38:42)
      at eachParent (node_modules/browserslist/node.js:46:13)
      at Object.getStat (node_modules/browserslist/node.js:197:15)
      at browserslist (node_modules/browserslist/index.js:433:19)
      at resolveTargets (node_modules/@babel/helper-compilation-targets/lib/index.js:174:46)
----
2021-03-01 13:55:20 +02:00
fisker Cheung 2f4140ff18 Test: Skip install for standalone test (#10273) 2021-02-11 00:50:59 +08:00
fisker Cheung f04b2b991c Enable no-implicit-coercion rule (#10186) 2021-02-01 13:14:04 +08:00
fisker Cheung edf668b173 Refactor needs-parens.js (part 2) (#9498) 2020-10-31 21:14:57 +08:00
fisker Cheung 3dbb584772 Disable Jest verbose, remove pattern for size check job (#9284) 2020-09-28 14:05:46 +08:00
fisker Cheung b77da32a80 Update postcss to v8 (#9209)
* Update `postcss` v8

* Parser custom properties

* Improve logic

* Update lint script

* Fix node location

* Fix comments inside

* Add a test

* Test on `less` and `scss` too

* Fix empty prop print

* Clean

* Update `postcss`

* Exclude `regenerator`

* Test `no-semi`

* Add changelog

* Typo

* Apply review suggestion

* Style

* Simplify logic

* Remove error test, we don't throw on this anymore

* Style

* Update postcss

* Update postcss
2020-09-25 00:51:55 +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
Yuku Kotaniandfisker 549090a5ba Add ESM distributions for browser (#8983)
Co-authored-by: fisker <lionkay@gmail.com>
2020-09-17 00:08:44 +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 Cheung 76f8455f05 Prevent jest warning on production tests (#9022) 2020-08-22 01:00:33 +08:00
fisker Cheung d31ebf4619 Test: Improve coverage (#8811) 2020-08-21 09:43:24 +08:00
fisker Cheung 42dac21e52 Update test:dist-standalone script (#8802) 2020-07-20 20:20:22 +08:00
fisker Cheung d072671842 Test: fix standalone tests with plugins option (#8787) 2020-07-19 17:53:30 +08:00
fisker Cheung 8999cc7811 Format Vue SFC root blocks (#8465) 2020-06-17 19:18:29 +08:00
fisker Cheung 9686475c80 Test: Remove graceful-fs hack (#8245) 2020-05-11 09:05:48 +08:00
fisker Cheung 305fea8a59 Codebase install test (#6373) 2020-04-23 10:37:09 +08:00
fisker Cheung 118b79f0c9 Refactor production tests (#8073) 2020-04-18 01:24:22 +08:00
fisker Cheung 257c9da18a Try upload coverage with token (#7930) 2020-04-01 18:32:39 +03:00
fisker Cheung 412694e1c5 Tweak test and CI configs (#7866)
* Set `jest` verbose to false by default

* Correct `doc-debug.js` path

* Remove outdated ignore patterns

* Exclude Node.js 13 on macos
2020-03-26 17:02:43 +02:00
fisker CheungandGeorgii Dolzhykov 34115cbd3c Remove azure pipelines (#7824)
* Followup work on setup github actions

* Coverage report & split `prod_lint`

* Add env

* Remove coverage report on azure pipelines

* Remove build step on lint

* remove coverage report on prod_test

* Use `ci-info` instead of `is-ci`

* Always enable `ENABLE_TEST_RESULTS` and `AST_COMPARE` on CI

* Standalone test and remove some env

* coverage report

* reduce matrix

* standalone test

* `ci-info`

* Remove token

* Disable `coverage` on azure pipelines

* use master version of codecov-action

* Link to master status

* fix prod lint

* Use boolean env

* Remove locv report

* Try lcov report

* pin `codecov-action` version, enable `verbose`

* azure coverage

* Name

* Trigger CI

* Use `basename`

* Trigger CI

* Try `runInBand`

* try `maxWorkers`

* Remove azure pipelines

* clean up

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-03-23 11:56:02 +02:00
fisker CheungandGeorgii Dolzhykov 54f907dba3 Followup work on setup github actions (#7431)
* Followup work on setup github actions

* Coverage report & split `prod_lint`

* Add env

* Remove coverage report on azure pipelines

* Remove build step on lint

* remove coverage report on prod_test

* Use `ci-info` instead of `is-ci`

* Always enable `ENABLE_TEST_RESULTS` and `AST_COMPARE` on CI

* Standalone test and remove some env

* coverage report

* reduce matrix

* standalone test

* `ci-info`

* Remove token

* Disable `coverage` on azure pipelines

* use master version of codecov-action

* Link to master status

* fix prod lint

* Use boolean env

* Remove locv report

* Try lcov report

* pin `codecov-action` version, enable `verbose`

* azure coverage

* Name

* Trigger CI

* Use `basename`

* Trigger CI

* Try `runInBand`

* try `maxWorkers`

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-03-23 03:36:44 +02:00
Georgii Dolzhykov 9dad95b35f Bump Prettier dependency to 2.0.0 2020-03-21 22:09:54 +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
Georgii Dolzhykov d83277bdf2 remove code for old Node from jest config 2020-01-10 00:45:51 +02:00
Ika f94f63b040 chore: update azure pipelines (#5611)
- upload coverage report (codecov) from azure pipelines
- only build `dist` once (`dist` is now shared between production jobs)
- run production tests on macOS (not sure why but it's faster than others)
- extract shareable steps
- remove travis/circle
2018-12-18 08:16:32 +08:00
Ika 952bc0cc03 fix: get rid of CRLF (#5494) 2018-12-08 18:28:29 +08:00
Danny McCormick 18b03a31cc Fix tests for Windows and add Azure Pipelines for cross platform CI (#5410)
* Add azure pipelines

* Add gitattributes

* Updating tests to work on Windows or Unix

* Lint

* Cleaning up

* Fixing names

* Clean up naming

* try to consolidate images

* Clean up

* Add back txt to gitattributes
2018-11-14 07:55:50 -05:00
Ika 55e620bdc7 chore: extract jest snapshot serializers (#5034) 2018-09-01 12:11:19 +08:00
Ika 3842cbb118 fix(typescript): use the first error when both failed (#4947) 2018-08-09 10:21:00 +08:00
Jed Fox dc362c212d Report test summaries to CircleCI (#4704)
* Report test summaries to CircleCI

* Don’t run jest-junit on Node <6

(it uses default function parameters)

* Address @lydell’s comment

* Use @duailibe’s suggestion

* 🔥 `jest-junit` key in production package.json

* Move config to jest.config.js
2018-07-07 12:11:04 -04:00
Simen Bekkhus e25021711d Upgrade to Jest 23 (#4809) 2018-07-04 16:54:39 -03: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
Lucas Duailibe 889b7dab79 Run tests using the standalone build in an empty context (#4668)
Validate that our build is stripping all the "native" dependencies (native modules and env vars).
2018-06-12 15:05:40 -03:00
Lucas Azzola b0cb63a7bb Use destructuring for imports (#4554)
* Use destructuring for imports

* Clean up integration tests

* Use moduleNameMapper for require_prettier
2018-05-27 21:36:12 +10:00
Lucas Duailibe 52a2a46b3c New build system (#4449) 2018-05-24 15:30:45 -03:00
Lucas Duailibe 8015e417c0 Separate entry for web bundle (#4386) 2018-04-26 13:38:57 -03:00
Lucas Duailibe 67f1c4877e Refactoring: better boundaries for different parts of the project (#4364) 2018-04-25 13:29:35 -03:00
Lucas Azzola e5d6a4704f Automatically load plugins from package.json (#3624)
* Automatically load plugins from package.json

* Fix build by adding json extension

* Fixup misuse of options argument

* Rewire graceful-fs to fs

* Document graceful-fs issue

* Alias graceful-fs to fs in Rollup
2018-01-05 21:09:51 +11:00
Simon Lydell 43cb08c45c Make production tests always run against dist/ (attempt 2) (#2942)
* Make production tests always run against dist/

* Try to mock process.stdin instead of get-stream

* fix: mock `get-stream` from `index.js`

* refactor: remove unnecessary variable

* Try `transform: {}` in jest.config.js

* Add comment explaining the unusual get-stream mocking
2017-10-02 17:58:55 +02:00
Lucas Azzola d62d1c5c56 Preserve parens with keyof, enforce parens with arrows with type params (#2503)
* Force parens around argument of simple arrow function if type annotation is present

* Preserve parens inside keyof operator
2017-07-17 13:32:33 +02:00
Lucas Azzola b7fa01af17 Enable code coverage in CI (#2497)
* Enable code coverage in CI

* Disable codecov comment

* Ignore some statements from coverage reports
2017-07-16 21:49:37 +10:00