@codecademy/gamut-tests 3.0.3-alpha.a809e8.0 → 3.0.3-alpha.ac420f.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +25 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
### [3.0.3-alpha.
|
|
6
|
+
### [3.0.3-alpha.ac420f.0](https://github.com/Codecademy/gamut/compare/@codecademy/gamut-tests@3.0.2...@codecademy/gamut-tests@3.0.3-alpha.ac420f.0) (2022-01-24)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @codecademy/gamut-tests
|
|
9
9
|
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { setupEnzyme as setupEnzymeBase, setupRtl as setupRtlBase } from 'component-test-setup';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const MockGamutProvider: React.FC;
|
|
4
|
+
export declare const setupEnzyme: typeof setupEnzymeBase;
|
|
5
|
+
export declare const setupRtl: typeof setupRtlBase;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { GamutProvider, theme } from '@codecademy/gamut-styles';
|
|
2
|
+
import { setupEnzyme as setupEnzymeBase, setupRtl as setupRtlBase } from 'component-test-setup';
|
|
3
|
+
import { overArgs } from 'lodash';
|
|
4
|
+
import React from 'react'; // See https://www.notion.so/codecademy/Frontend-Unit-Tests-1cbf4e078a6647559b4583dfb6d3cb18
|
|
5
|
+
|
|
6
|
+
export var MockGamutProvider = function MockGamutProvider(_ref) {
|
|
7
|
+
var children = _ref.children;
|
|
8
|
+
return /*#__PURE__*/React.createElement(GamutProvider, {
|
|
9
|
+
useGlobals: false,
|
|
10
|
+
useCache: false,
|
|
11
|
+
theme: theme
|
|
12
|
+
}, children);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
function withMockGamutProvider(WrappedComponent) {
|
|
16
|
+
var WithBoundaryComponent = function WithBoundaryComponent(props) {
|
|
17
|
+
return /*#__PURE__*/React.createElement(MockGamutProvider, null, /*#__PURE__*/React.createElement(WrappedComponent, props));
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return WithBoundaryComponent;
|
|
21
|
+
} // overArgs isn't fully typed yet for lack of curried generics, so we have to cast it...
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
export var setupEnzyme = overArgs(setupEnzymeBase, withMockGamutProvider);
|
|
25
|
+
export var setupRtl = overArgs(setupRtlBase, withMockGamutProvider);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@codecademy/gamut-styles": "12.1.2-alpha.
|
|
4
|
+
"@codecademy/gamut-styles": "12.1.2-alpha.ac420f.0",
|
|
5
5
|
"component-test-setup": "*",
|
|
6
6
|
"lodash": "^4.17.5"
|
|
7
7
|
},
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"rtl"
|
|
15
15
|
],
|
|
16
16
|
"name": "@codecademy/gamut-tests",
|
|
17
|
-
"version": "3.0.3-alpha.
|
|
17
|
+
"version": "3.0.3-alpha.ac420f.0",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"main": "./dist/index.js",
|
|
20
20
|
"module": "dist/index.js",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"lernaBuildTask": "yarn build"
|
|
38
38
|
},
|
|
39
39
|
"types": "./dist/index.d.ts",
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "7026274f2ac36f45b325c9959c7445d3511ff2da"
|
|
41
41
|
}
|