@storybook/addon-jest
Advanced tools
Comparing version 4.0.0-alpha.24 to 4.0.0-alpha.25
@@ -14,9 +14,14 @@ "use strict"; | ||
var findTestResults = function findTestResults(testFiles, jestTestResults, jestTestFilesExt) { | ||
var _upath = require("upath"); | ||
var findTestResults = function findTestResults(testFiles, jestTestResults, jestTestFilesOptions) { | ||
return Object.values(testFiles).map(function (name) { | ||
var fileName = "".concat(name).concat(jestTestFilesOptions.filesExt); | ||
if (jestTestResults && jestTestResults.testResults) { | ||
return { | ||
fileName: fileName, | ||
name: name, | ||
result: jestTestResults.testResults.find(function (t) { | ||
return new RegExp("".concat(name).concat(jestTestFilesExt)).test(t.name); | ||
return (0, _upath.normalize)(t.name).includes(fileName); | ||
}) | ||
@@ -27,2 +32,3 @@ }; | ||
return { | ||
fileName: fileName, | ||
name: name | ||
@@ -29,0 +35,0 @@ }; |
@@ -17,6 +17,8 @@ "use strict"; | ||
_addons.default.addPanel('storybook/tests/panel', { | ||
title: _react.default.createElement(_PanelTitle.default, { | ||
channel: _addons.default.getChannel(), | ||
api: api | ||
}), | ||
title: function title() { | ||
return _react.default.createElement(_PanelTitle.default, { | ||
channel: channel, | ||
api: api | ||
}); | ||
}, | ||
// eslint-disable-next-line react/prop-types | ||
@@ -23,0 +25,0 @@ render: function render(_ref) { |
{ | ||
"name": "@storybook/addon-jest", | ||
"version": "4.0.0-alpha.24", | ||
"version": "4.0.0-alpha.25", | ||
"description": "React storybook addon that show component jest report", | ||
@@ -34,6 +34,7 @@ "keywords": [ | ||
"@emotion/styled": "^0.10.6", | ||
"@storybook/addons": "4.0.0-alpha.24", | ||
"@storybook/components": "4.0.0-alpha.24", | ||
"@storybook/addons": "4.0.0-alpha.25", | ||
"@storybook/components": "4.0.0-alpha.25", | ||
"global": "^4.3.2", | ||
"prop-types": "^15.6.2", | ||
"upath": "^1.1.0", | ||
"util-deprecate": "^1.0.2" | ||
@@ -44,3 +45,3 @@ }, | ||
}, | ||
"gitHead": "bdc8120ab9456b34e2f67692cc3439ac75c4ba54" | ||
"gitHead": "155afad695926070cc6426e98d795907846f1207" | ||
} |
import addons from '@storybook/addons'; | ||
import deprecate from 'util-deprecate'; | ||
import { normalize } from 'upath'; | ||
const findTestResults = (testFiles, jestTestResults, jestTestFilesExt) => | ||
const findTestResults = (testFiles, jestTestResults, jestTestFilesOptions) => | ||
Object.values(testFiles).map(name => { | ||
const fileName = `${name}${jestTestFilesOptions.filesExt}`; | ||
if (jestTestResults && jestTestResults.testResults) { | ||
return { | ||
fileName, | ||
name, | ||
result: jestTestResults.testResults.find(t => | ||
new RegExp(`${name}${jestTestFilesExt}`).test(t.name) | ||
), | ||
result: jestTestResults.testResults.find(t => normalize(t.name).includes(fileName)), | ||
}; | ||
} | ||
return { name }; | ||
return { fileName, name }; | ||
}); | ||
@@ -16,0 +17,0 @@ |
@@ -10,3 +10,3 @@ import React from 'react'; | ||
addons.addPanel('storybook/tests/panel', { | ||
title: <PanelTitle channel={addons.getChannel()} api={api} />, | ||
title: () => <PanelTitle channel={channel} api={api} />, | ||
// eslint-disable-next-line react/prop-types | ||
@@ -13,0 +13,0 @@ render: ({ active }) => <Panel channel={channel} api={api} active={active} />, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5237863
2022
8
+ Addedupath@^1.1.0
+ Added@storybook/addons@4.0.0-alpha.25(transitive)
+ Added@storybook/channels@4.0.0-alpha.25(transitive)
+ Added@storybook/components@4.0.0-alpha.25(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedupath@1.2.0(transitive)
- Removed@storybook/addons@4.0.0-alpha.24(transitive)
- Removed@storybook/channels@4.0.0-alpha.24(transitive)
- Removed@storybook/components@4.0.0-alpha.24(transitive)
- Removedlodash.pick@4.4.0(transitive)
- Removedlodash.throttle@4.1.1(transitive)