Skip to content

Commit

Permalink
[#61] v1.6.2: Migration tsd-lite > tstyche + Update of dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
birdofpreyru committed Jun 3, 2024
1 parent 5369d34 commit 116f8fe
Show file tree
Hide file tree
Showing 19 changed files with 1,693 additions and 1,460 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.12.2
20.14.0
106 changes: 53 additions & 53 deletions __tests__/js/__snapshots__/index.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ exports[`01 - No default theme. 01 - No options at registration. 01 - No extra t

exports[`01 - No default theme. 01 - No options at registration. 02 - Ad hoc theme 1`] = `
<div
className="theme-a__container___KKR91"
class="theme-a__container___KKR91"
>
<div
className="theme-a__content___yA6Ea"
class="theme-a__content___yA6Ea"
>
Child
</div>
Expand All @@ -34,15 +34,15 @@ exports[`01 - No default theme. 01 - No options at registration. 03 - Context th

exports[`01 - No default theme. 01 - No options at registration. 03 - Context theme 2`] = `
<div
className="theme-b__container___atStN"
class="theme-b__container___atStN"
>
<div />
</div>
`;

exports[`01 - No default theme. 01 - No options at registration. 03 - Context theme 3`] = `
<div
className="theme-b__container___atStN"
class="theme-b__container___atStN"
>
<div />
</div>
Expand All @@ -51,54 +51,54 @@ exports[`01 - No default theme. 01 - No options at registration. 03 - Context th
exports[`01 - No default theme. 01 - No options at registration. 04 - Context + ad hoc 1`] = `
<div>
<div
className="theme-c__content___tcrzy"
class="theme-c__content___tcrzy"
/>
</div>
`;

exports[`01 - No default theme. 01 - No options at registration. 04 - Context + ad hoc 2`] = `
<div
className="theme-b__container___atStN"
class="theme-b__container___atStN"
>
<div
className="theme-c__content___tcrzy"
class="theme-c__content___tcrzy"
/>
</div>
`;

exports[`01 - No default theme. 01 - No options at registration. 04 - Context + ad hoc 3`] = `
<div
className="theme-a__container___KKR91"
class="theme-a__container___KKR91"
>
<div
className="theme-a__content___yA6Ea theme-c__ad___pkn9n theme-c__hoc___MQR5Y theme-c__content___tcrzy"
class="theme-a__content___yA6Ea theme-c__ad___pkn9n theme-c__hoc___MQR5Y theme-c__content___tcrzy"
/>
</div>
`;

exports[`01 - No default theme. 01 - No options at registration. 04 - Context + ad hoc 4`] = `
<div
className="theme-b__container___atStN"
class="theme-b__container___atStN"
>
<div
className="theme-c__content___tcrzy"
class="theme-c__content___tcrzy"
/>
</div>
`;

exports[`01 - No default theme. 01 - No options at registration. 05 - Context + ad hoc + composition modes 1`] = `
<div
className="theme-b__container___atStN"
class="theme-b__container___atStN"
>
<div
className="theme-a__content___yA6Ea"
class="theme-a__content___yA6Ea"
/>
</div>
`;

exports[`01 - No default theme. 01 - No options at registration. 05 - Context + ad hoc + composition modes 2`] = `
<div
className="theme-b__container___atStN"
class="theme-b__container___atStN"
>
<div />
</div>
Expand All @@ -109,14 +109,14 @@ exports[`01 - No default theme. 01 - No options at registration. 05 - Context +
exports[`01 - No default theme. 01 - No options at registration. 06 - Nested ThemeProvider does not shadow parent themes it does not override 1`] = `
[
<div
className="theme-a__container___KKR91"
class="theme-a__container___KKR91"
>
<div
className="theme-a__content___yA6Ea"
class="theme-a__content___yA6Ea"
/>
</div>,
<div
className="theme-b__container___atStN"
class="theme-b__container___atStN"
>
<div />
</div>,
Expand All @@ -125,20 +125,20 @@ exports[`01 - No default theme. 01 - No options at registration. 06 - Nested The

exports[`02 - With default theme 01 - No options at registration. 01 - No extra themes 1`] = `
<div
className="theme-a__container___KKR91"
class="theme-a__container___KKR91"
>
<div
className="theme-a__content___yA6Ea"
class="theme-a__content___yA6Ea"
/>
</div>
`;

exports[`02 - With default theme 01 - No options at registration. 01 - No extra themes 2`] = `
<div
className="theme-a__container___KKR91"
class="theme-a__container___KKR91"
>
<div
className="theme-a__content___yA6Ea"
class="theme-a__content___yA6Ea"
>
Child
</div>
Expand All @@ -147,10 +147,10 @@ exports[`02 - With default theme 01 - No options at registration. 01 - No extra

exports[`02 - With default theme 01 - No options at registration. 02 - Ad hoc theme 1`] = `
<div
className="theme-a__container___KKR91 theme-b__ad___TwfGm theme-b__hoc___QB2GB theme-b__container___atStN"
class="theme-a__container___KKR91 theme-b__ad___TwfGm theme-b__hoc___QB2GB theme-b__container___atStN"
>
<div
className="theme-a__content___yA6Ea"
class="theme-a__content___yA6Ea"
>
Child
</div>
Expand All @@ -159,86 +159,86 @@ exports[`02 - With default theme 01 - No options at registration. 02 - Ad hoc th

exports[`02 - With default theme 01 - No options at registration. 03 - Context theme 1`] = `
<div
className="theme-a__container___KKR91"
class="theme-a__container___KKR91"
>
<div
className="theme-a__content___yA6Ea"
class="theme-a__content___yA6Ea"
/>
</div>
`;

exports[`02 - With default theme 01 - No options at registration. 03 - Context theme 2`] = `
<div
className="theme-a__container___KKR91 theme-b__context___RaJ9p theme-b__container___atStN"
class="theme-a__container___KKR91 theme-b__context___RaJ9p theme-b__container___atStN"
>
<div
className="theme-a__content___yA6Ea"
class="theme-a__content___yA6Ea"
/>
</div>
`;

exports[`02 - With default theme 01 - No options at registration. 03 - Context theme 3`] = `
<div
className="theme-b__container___atStN"
class="theme-b__container___atStN"
>
<div />
</div>
`;

exports[`02 - With default theme 01 - No options at registration. 04 - Context + ad hoc 1`] = `
<div
className="theme-a__container___KKR91"
class="theme-a__container___KKR91"
>
<div
className="theme-a__content___yA6Ea theme-c__ad___pkn9n theme-c__hoc___MQR5Y theme-c__content___tcrzy"
class="theme-a__content___yA6Ea theme-c__ad___pkn9n theme-c__hoc___MQR5Y theme-c__content___tcrzy"
/>
</div>
`;

exports[`02 - With default theme 01 - No options at registration. 04 - Context + ad hoc 2`] = `
<div
className="theme-a__container___KKR91 theme-b__context___RaJ9p theme-b__container___atStN"
class="theme-a__container___KKR91 theme-b__context___RaJ9p theme-b__container___atStN"
>
<div
className="theme-a__content___yA6Ea theme-c__ad___pkn9n theme-c__hoc___MQR5Y theme-c__content___tcrzy"
class="theme-a__content___yA6Ea theme-c__ad___pkn9n theme-c__hoc___MQR5Y theme-c__content___tcrzy"
/>
</div>
`;

exports[`02 - With default theme 01 - No options at registration. 04 - Context + ad hoc 3`] = `
<div
className="theme-a__container___KKR91"
class="theme-a__container___KKR91"
>
<div
className="theme-a__content___yA6Ea theme-c__context___c9i1d theme-c__content___tcrzy theme-d__ad___CxaN3 theme-d__hoc___Ymq3c theme-d__content___h6mrz"
class="theme-a__content___yA6Ea theme-c__context___c9i1d theme-c__content___tcrzy theme-d__ad___CxaN3 theme-d__hoc___Ymq3c theme-d__content___h6mrz"
/>
</div>
`;

exports[`02 - With default theme 01 - No options at registration. 05 - Context + ad hoc + composition modes 1`] = `
<div
className="theme-a__container___KKR91"
class="theme-a__container___KKR91"
>
<div
className="theme-c__content___tcrzy theme-a__context___kW3Il theme-a__content___yA6Ea theme-d__ad___CxaN3 theme-d__hoc___Ymq3c theme-d__content___h6mrz"
class="theme-c__content___tcrzy theme-a__context___kW3Il theme-a__content___yA6Ea theme-d__ad___CxaN3 theme-d__hoc___Ymq3c theme-d__content___h6mrz"
/>
</div>
`;

exports[`02 - With default theme 01 - No options at registration. 05 - Context + ad hoc + composition modes 2`] = `
<div
className="theme-a__container___KKR91"
class="theme-a__container___KKR91"
>
<div
className="theme-a__content___yA6Ea theme-d__ad___CxaN3 theme-d__hoc___Ymq3c theme-d__content___h6mrz"
class="theme-a__content___yA6Ea theme-d__ad___CxaN3 theme-d__hoc___Ymq3c theme-d__content___h6mrz"
/>
</div>
`;

exports[`02 - With default theme 01 - No options at registration. 05 - Context + ad hoc + composition modes 3`] = `
<div>
<div
className="theme-c__content___tcrzy theme-d__ad___CxaN3 theme-d__hoc___Ymq3c theme-d__content___h6mrz"
class="theme-c__content___tcrzy theme-d__ad___CxaN3 theme-d__hoc___Ymq3c theme-d__content___h6mrz"
/>
</div>
`;
Expand Down Expand Up @@ -267,54 +267,54 @@ exports[`02 - With default theme 01 - No options at registration. 06 - Theme pro

exports[`02 - With default theme 02 - Options at registration 01 - composeContextTheme 1`] = `
<div
className="theme-b__container___atStN"
class="theme-b__container___atStN"
>
<div />
</div>
`;

exports[`02 - With default theme 02 - Options at registration 01 - composeContextTheme 2`] = `
<div
className="theme-b__container___atStN"
class="theme-b__container___atStN"
>
<div
className="theme-a__content___yA6Ea"
class="theme-a__content___yA6Ea"
/>
</div>
`;

exports[`02 - With default theme 02 - Options at registration 02 - composeAdhocTheme 1`] = `
<div
className="theme-b__container___atStN"
class="theme-b__container___atStN"
>
<div />
</div>
`;

exports[`02 - With default theme 02 - Options at registration 02 - composeAdhocTheme 2`] = `
<div
className="theme-b__container___atStN"
class="theme-b__container___atStN"
>
<div
className="theme-a__content___yA6Ea"
class="theme-a__content___yA6Ea"
/>
</div>
`;

exports[`02 - With default theme 02 - Options at registration 03 - themePriority 1`] = `
[
<div
className="theme-b__container___atStN theme-a__context___kW3Il theme-a__container___KKR91"
class="theme-b__container___atStN theme-a__context___kW3Il theme-a__container___KKR91"
>
<div
className="theme-a__content___yA6Ea theme-c__ad___pkn9n theme-c__hoc___MQR5Y theme-c__content___tcrzy"
class="theme-a__content___yA6Ea theme-c__ad___pkn9n theme-c__hoc___MQR5Y theme-c__content___tcrzy"
/>
</div>,
<div
className="theme-a__container___KKR91 theme-b__context___RaJ9p theme-b__container___atStN"
class="theme-a__container___KKR91 theme-b__context___RaJ9p theme-b__container___atStN"
>
<div
className="theme-a__content___yA6Ea theme-c__ad___pkn9n theme-c__hoc___MQR5Y theme-c__content___tcrzy"
class="theme-a__content___yA6Ea theme-c__ad___pkn9n theme-c__hoc___MQR5Y theme-c__content___tcrzy"
/>
</div>,
]
Expand Down Expand Up @@ -343,10 +343,10 @@ exports[`02 - With default theme 02 - Options at registration 04 - Theme props m

exports[`02 - With default theme 02 - Options at registration 04 - Theme props mapping 3`] = `
<div
className="theme-a__container___KKR91"
class="theme-a__container___KKR91"
>
<div
className="theme-a__content___yA6Ea"
class="theme-a__content___yA6Ea"
/>
</div>
`;
Expand All @@ -369,10 +369,10 @@ exports[`02 - With default theme 02 - Options at registration 04 - Theme props m

exports[`02 - With default theme 02 - Options at registration 05 - Specifity tags 1`] = `
<div
className="theme-a__container___KKR91 theme-b__container___atStN"
class="theme-a__container___KKR91 theme-b__container___atStN"
>
<div
className="theme-a__content___yA6Ea theme-c__hoc___MQR5Y theme-c__content___tcrzy"
class="theme-a__content___yA6Ea theme-c__hoc___MQR5Y theme-c__content___tcrzy"
/>
</div>
`;
Expand Down
4 changes: 2 additions & 2 deletions __tests__/js/__snapshots__/theme-schema.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ exports[`Theme verification Reports correct errors with invalid theme 1`] = `
`;

exports[`Theme verification Theme casting works 1`] = `
"{
{
"container": "theme-with-extra-styles__container___LGePT",
"content": "theme-with-extra-styles__content___t3G6J",
"ad": "theme-with-extra-styles__ad___Zfhge",
"hoc": "theme-with-extra-styles__hoc___iJt7B",
"context": "theme-with-extra-styles__context___rKdYL"
}"
}
`;

exports[`Theme verification Theme is missing and is required 1`] = `"Theme is not provided to Component component"`;
2 changes: 2 additions & 0 deletions __tests__/js/index.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/** @jest-environment jsdom */

import themed, { COMPOSE, PRIORITY, ThemeProvider } from '../../src';

import { snapshot } from '../../jest/utils';
Expand Down
2 changes: 2 additions & 0 deletions __tests__/js/theme-schema.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/** @jest-environment jsdom */

/**
* Tests for theme schema verifier, and casting.
*/
Expand Down
9 changes: 4 additions & 5 deletions __tests__/ts-types/TestComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { expectError } from 'tsd-lite';
import { expect } from 'tstyche';

import themed from '../../src';
import TestComponent from '../../jest/TestComponent';

expectError(<TestComponent />);
expect(<TestComponent />).type.toRaiseError(2741);

const Themed = themed(TestComponent, 'Themed');

expectError(<Themed badKey="value" />);

<Themed goodKey="good" />;
expect(<Themed badKey="value" />).type.toRaiseError(2322);
expect(<Themed goodKey="good" />).type.not.toRaiseError();
Loading

0 comments on commit 116f8fe

Please sign in to comment.