Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
29c89de1
Unverified
Commit
29c89de1
authored
Jul 15, 2019
by
Dominik Prokop
Committed by
GitHub
Jul 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grafana/toolkit: update the way config is being passed to jest cli (#18115)
parent
88d9a3b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
packages/grafana-toolkit/src/cli/tasks/plugin/tests.ts
+8
-3
packages/grafana-toolkit/src/config/jest.plugin.config.ts
+10
-6
No files found.
packages/grafana-toolkit/src/cli/tasks/plugin/tests.ts
View file @
29c89de1
...
...
@@ -10,10 +10,15 @@ export interface PluginTestOptions {
export
const
testPlugin
=
useSpinner
<
PluginTestOptions
>
(
'Running tests'
,
async
({
updateSnapshot
,
coverage
})
=>
{
const
testConfig
=
jestConfig
();
testConfig
.
updateSnapshot
=
updateSnapshot
;
testConfig
.
coverage
=
coverage
;
const
cliConfig
=
{
config
:
JSON
.
stringify
(
testConfig
),
updateSnapshot
,
coverage
,
passWithNoTests
:
true
,
};
const
results
=
await
jestCLI
.
runCLI
(
testConfig
as
any
,
[
process
.
cwd
()]);
// @ts-ignore
const
results
=
await
jestCLI
.
runCLI
(
cliConfig
,
[
process
.
cwd
()]);
if
(
results
.
results
.
numFailedTests
>
0
||
results
.
results
.
numFailedTestSuites
>
0
)
{
throw
new
Error
(
'Tests failed'
);
...
...
packages/grafana-toolkit/src/config/jest.plugin.config.ts
View file @
29c89de1
import
path
=
require
(
'path'
);
import
fs
=
require
(
'fs'
);
const
whitelistedJestConfigOverrides
=
[
'snapshotSerializers'
];
const
whitelistedJestConfigOverrides
=
[
'snapshotSerializers'
,
'moduleNameMapper'
];
export
const
jestConfig
=
()
=>
{
const
jestConfigOverrides
=
require
(
path
.
resolve
(
process
.
cwd
(),
'package.json'
)).
jest
;
...
...
@@ -23,17 +23,21 @@ export const jestConfig = () => {
const
defaultJestConfig
=
{
preset
:
'ts-jest'
,
verbose
:
false
,
transform
:
{
'^.+
\\
.(ts|tsx)$'
:
'ts-jest'
,
},
moduleDirectories
:
[
'node_modules'
,
'src'
],
moduleFileExtensions
:
[
'ts'
,
'tsx'
,
'js'
,
'jsx'
,
'json'
],
setupFiles
,
globals
:
{
'ts-jest'
:
{
isolatedModules
:
true
}
},
coverageReporters
:
[
'json-summary'
,
'text'
,
'lcov'
],
collectCoverageFrom
:
[
'src/**/*.{ts,tsx}'
,
'!**/node_modules/**'
,
'!**/vendor/**'
],
updateSnapshot
:
false
,
passWithNoTests
:
true
,
testMatch
:
[
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}'
,
'<rootDir>/src/**/*.{spec,test,jest}.{js,jsx,ts,tsx}'
,
],
transformIgnorePatterns
:
[
'[/
\\\\\\\\
]node_modules[/
\\\\\\\\
].+
\\\\
.(js|jsx|ts|tsx)$'
,
'^.+
\\\\
.module
\\\\
.(css|sass|scss)$'
,
],
};
return
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment