Commit Graph
62 Commits
Author SHA1 Message Date
fisker Cheung 05a5ff54d0 Add failed test back (#17384) 2025-04-22 17:17:47 +08:00
fisker Cheung 17a551dea7 Test: Remove --runInBand (#17378) 2025-04-20 22:23:37 +08:00
fisker Cheung 4b2db262b7 Migrated version.evaluate.cjs to ES Module (#17347) 2025-04-16 13:39:48 +08:00
fisker Cheung 377b231a5d Bundle package into dist/prettier/ (#15825) 2025-04-09 08:38:46 +08:00
fisker Cheung 5b3dd6a6ef Add script to ensure format test directories contains format test script (#17077) 2025-02-08 17:27:43 +08:00
fisker Cheung 07b468917e Remove blank lines between imports (#16450) 2024-09-29 17:56:37 +08:00
Klaus Hott Vidalandfisker 16449ce914 renaming jsfmt.spec.js to format.test.js (#16244)
Co-authored-by: fisker <lionkay@gmail.com>
2024-05-06 10:25:10 +08:00
5ceeccf38d chore(deps): update dependency typescript to v5.4.3 (#16181)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
Co-authored-by: Sosuke Suzuki <sosuke.suzuki@dr-ubie.com>
2024-04-08 14:26:54 +08:00
Alexander Kachkaev 1ea2fd059a Add eslint-plugin-simple-import-sort (#15817) 2023-12-18 03:34:12 +08:00
renovate[bot]andfisker Cheung c6d08e05e7 chore(deps): update dependency parse-json to v8 (#15590)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-11-06 19:17:31 +08:00
Sosuke Suzuki fa48415617 Bump Prettier dependency to 3.0.0 2023-07-05 21:50:05 +09:00
fisker Cheung 186a177017 Rename .mjs files to .js (#14605) 2023-03-28 16:18:53 +08:00
fisker Cheung 1bdd1d115c Update execa to v6 (#11826) 2021-11-29 10:07:11 +08:00
fisker Cheung 0cc8e96c37 Refactor installPrettier (#11476) 2021-09-09 18:53:31 +08:00
Sosuke Suzuki bf2a24fdd1 Add tests for release script (#11454)
* Install jest

* Configure jest script

* Fix eslintrc

* Add @types/jest

* Add test for validate-new-version

* Fix eslintrc

* Add workflow file

* Add node version

* cd to script/release

* Fix workflow file

* Fix version

* Ignore from root

* Update yarn.lock

* Set defaults.run.working-directory
2021-09-07 14:53:45 +09:00
fisker Cheung 894f841fbd Style: Enforce extensions (#11227) 2021-07-21 09:10:34 +08:00
fisker Cheung 81a1c46311 Minor tweak to js printer (#10954) 2021-05-27 18:00:31 +08:00
fisker Cheung 2783bb41b1 Update jest to v27 (#10947) 2021-05-26 09:03:29 +08:00
fisker Cheung ece93681f1 Restructure test files (#10415) 2021-04-25 20:01:56 +08:00
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