@codecademy/gamut-tests 5.0.6 → 5.0.7-alpha.187436.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/package.json +3 -3
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -38
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": "16.1.
|
|
4
|
+
"@codecademy/gamut-styles": "16.1.3-alpha.187436.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": "5.0.
|
|
17
|
+
"version": "5.0.7-alpha.187436.0",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"main": "dist/index.js",
|
|
20
20
|
"module": "dist/index.js",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"build": "nx build @codecademy/gamut-tests"
|
|
37
37
|
},
|
|
38
38
|
"types": "./dist/index.d.ts",
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "25fdee2557622798d089488b96934207d3c4800c"
|
|
40
40
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { setupEnzyme as setupEnzymeBase, setupRtl as setupRtlBase } from 'component-test-setup';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
export declare const MockGamutProvider: React.FC<{
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
}>;
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Enzyme is no longer being maintained. Use RTL instead.
|
|
8
|
-
*/
|
|
9
|
-
export declare const setupEnzyme: typeof setupEnzymeBase;
|
|
10
|
-
export declare const setupRtl: typeof setupRtlBase;
|
package/dist/index.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
-
import { GamutProvider, theme } from '@codecademy/gamut-styles';
|
|
8
|
-
import { setupEnzyme as setupEnzymeBase, setupRtl as setupRtlBase } from 'component-test-setup';
|
|
9
|
-
import { overArgs } from 'lodash';
|
|
10
|
-
import * as React from 'react';
|
|
11
|
-
|
|
12
|
-
// See https://www.notion.so/codecademy/Frontend-Unit-Tests-1cbf4e078a6647559b4583dfb6d3cb18
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
export var MockGamutProvider = function MockGamutProvider(_ref) {
|
|
15
|
-
var children = _ref.children;
|
|
16
|
-
return /*#__PURE__*/_jsx(GamutProvider, {
|
|
17
|
-
useGlobals: false,
|
|
18
|
-
useCache: false,
|
|
19
|
-
theme: theme,
|
|
20
|
-
children: children
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
function withMockGamutProvider(WrappedComponent) {
|
|
24
|
-
var WithBoundaryComponent = function WithBoundaryComponent(props) {
|
|
25
|
-
return /*#__PURE__*/_jsx(MockGamutProvider, {
|
|
26
|
-
children: /*#__PURE__*/_jsx(WrappedComponent, _objectSpread({}, props))
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
return WithBoundaryComponent;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// overArgs isn't fully typed yet for lack of curried generics, so we have to cast it...
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated Enzyme is no longer being maintained. Use RTL instead.
|
|
36
|
-
*/
|
|
37
|
-
export var setupEnzyme = overArgs(setupEnzymeBase, withMockGamutProvider);
|
|
38
|
-
export var setupRtl = overArgs(setupRtlBase, withMockGamutProvider);
|