10 Commits

Author SHA1 Message Date
Adam Wathan
fe27356680
JIT: Optimize universal selector usage by inlining only the relevant selectors (#4850)
* WIP

* run prettier

* drop new lines in custom matcher

Drop all newlines, let prettier handle everything for us.

* add cache for the selector parser

* add `@apply` tests for the universal optimizer

* drop comments

* initial replacements

* WIP

* WIP

* MAKE IT WORK

* Rename to resolveDefaultsAtRules

* Update tests + defaults identifiers

* Don't add @defaults in AOT mode

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2021-07-01 06:33:37 -04:00
Robin Malfait
63a67cb8ef
improve integration tests (#4572)
* remove unused file

using syntax.js instead

* add a way to remove files that are generated from the tests

Essentially setting the restore cache contents to `null` as a special
value.

* combine the stdout and stderr output

* add jest-diff instead of relying on it existing *somewhere*

This also came with a small API change.

* add `--runInBand` to the test script

* add dedicated cli tests for the new Tailwind CLI
2021-06-07 13:50:53 -04:00
Robin Malfait
7565099c1f
Integrations setup (#4354)
* add integration test tools

* setup jest in the integrations folder

* add `test:integrations` script

The default `npm test` script will ignore all the tests in the
`integrations` folder.

* add integration tests with `webpack 5`

* add integration tests with `postcss-cli`

* add `npm run install:integrations` script

This script will run `npm install` in every integration, and in the
integrations folder itself (to setup Jest for example).

* add `toIncludeCss` custom matcher

* increate Jest timeout for integration tests

* add integration tests with `vite`

* add integration tests with `webpack 4`

* add isomorphic fetch

* add the ability to wait for specific stdout/stderr output

* write vite tests, assert using API calls

We will wait for the correct stdout/stderr output, once we know that we
can request the fresh css, we will fetch it and make assertions
accordingly.

Port is currently hardcoded, maybe we should use a packaage to ensure
that we use a free port.

* add integration tests with `rollup`

* add integration tests with `parcel`

* run all integration tests in band

* add .gitignore in integrations folder
2021-05-18 11:21:35 -04:00
Adam Wathan
b242fb70b5 Unify test suites 2021-04-02 14:34:50 -04:00
Stefan Fisk
1e0fc09e0a
Fix !important on multiple selectors #2823 (#2824)
* Add failing test for #2823

* cleanup string literals

* use prettier for toMatchCSS diffs

* make sure that importants are applied correctly

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2020-11-26 14:53:58 +01:00
Adam Wathan
3259608813 Add 2xl breakpoint by default 2020-10-18 15:43:50 -04:00
Robin Malfait
ad7fec482b improve custom toMatchCss matcher 2020-08-28 08:50:13 -04:00
Adam Wathan
2cbc8e90af Add tests for all the new scenarios @apply now supports 2020-08-13 20:46:27 -04:00
Adam Wathan
ebb8633809 Fix tests and style 2017-11-23 09:58:25 -05:00
Adam Wathan
37b06c8dc9 Generate focus variants as separate declarations 2017-11-22 15:52:32 -05:00