mirror of
https://github.com/lowdefy/lowdefy.git
synced 2024-12-03 05:30:13 +08:00
chore: add codecov coverage reports
This commit is contained in:
parent
ec9bd03662
commit
cbcc2e49e2
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -23,3 +23,5 @@ jobs:
|
||||
# format tests don't pass on node 12 since icu is missing and tests don't work with locals
|
||||
- name: Test packages
|
||||
run: yarn test --ignore='@lowdefy/format'
|
||||
- name: Upload coverage to codecov
|
||||
run: bash <(curl -s https://codecov.io/bash)
|
||||
|
18
packages/blockTools/jest.config.js
Normal file
18
packages/blockTools/jest.config.js
Normal file
@ -0,0 +1,18 @@
|
||||
module.exports = {
|
||||
clearMocks: true,
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.{js,jsx}', '!demo/*'],
|
||||
coverageDirectory: 'coverage',
|
||||
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/tests/'],
|
||||
coverageReporters: ['lcov', 'text', 'clover'],
|
||||
errorOnDeprecated: true,
|
||||
testPathIgnorePatterns: ['<rootDir>/dist/'],
|
||||
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node', 'yaml', 'css'],
|
||||
moduleNameMapper: {
|
||||
'\\.(css|less)$': '<rootDir>/tests/__mocks__/styleMock.js',
|
||||
},
|
||||
transform: {
|
||||
'\\.yaml$': 'yaml-jest',
|
||||
'\\.js?$': 'babel-jest',
|
||||
},
|
||||
};
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"moduleFileExtensions": ["js", "json", "jsx", "ts", "tsx", "node", "yaml", "css"],
|
||||
"transform": {
|
||||
"\\.yaml$": "yaml-jest",
|
||||
"\\.js?$": "babel-jest"
|
||||
},
|
||||
"moduleNameMapper": {
|
||||
"\\.(css|less)$": "<rootDir>/tests/__mocks__/styleMock.js"
|
||||
},
|
||||
"collectCoverageFrom": ["src/**/*.{js,jsx}", "!demo/*"]
|
||||
}
|
@ -28,7 +28,7 @@
|
||||
"scripts": {
|
||||
"start": "webpack serve",
|
||||
"build": "babel src --out-dir dist",
|
||||
"test": "jest --coverage --config jest.config.json --no-cache",
|
||||
"test": "jest --coverage",
|
||||
"prepare": "yarn build",
|
||||
"prepublishOnly": "yarn build",
|
||||
"npm-publish": "npm publish --access public"
|
||||
@ -69,4 +69,4 @@
|
||||
"yaml-jest": "1.0.5",
|
||||
"yaml-loader": "0.6.0"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,20 +1,11 @@
|
||||
module.exports = {
|
||||
// Automatically clear mock calls and instances between every test
|
||||
clearMocks: true,
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.js'],
|
||||
|
||||
// The directory where Jest should output its coverage files
|
||||
coverageDirectory: 'coverage',
|
||||
|
||||
// An array of regexp pattern strings used to skip coverage collection
|
||||
coveragePathIgnorePatterns: ['/dist/'],
|
||||
|
||||
// A list of reporter names that Jest uses when writing coverage reports
|
||||
coverageReporters: ['text'],
|
||||
|
||||
// The test environment that will be used for testing
|
||||
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/test/'],
|
||||
coverageReporters: ['lcov', 'text', 'clover'],
|
||||
errorOnDeprecated: true,
|
||||
testEnvironment: 'node',
|
||||
|
||||
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
||||
testPathIgnorePatterns: ['/dist/'],
|
||||
testPathIgnorePatterns: ['<rootDir>/dist/'],
|
||||
};
|
||||
|
@ -1,20 +1,11 @@
|
||||
module.exports = {
|
||||
// Automatically clear mock calls and instances between every test
|
||||
clearMocks: true,
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.js'],
|
||||
|
||||
// The directory where Jest should output its coverage files
|
||||
coverageDirectory: 'coverage',
|
||||
|
||||
// An array of regexp pattern strings used to skip coverage collection
|
||||
coveragePathIgnorePatterns: ['/dist/'],
|
||||
|
||||
// A list of reporter names that Jest uses when writing coverage reports
|
||||
coverageReporters: ['text'],
|
||||
|
||||
// The test environment that will be used for testing
|
||||
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/test/'],
|
||||
coverageReporters: ['lcov', 'text', 'clover'],
|
||||
errorOnDeprecated: true,
|
||||
testEnvironment: 'node',
|
||||
|
||||
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
||||
testPathIgnorePatterns: ['/dist/'],
|
||||
testPathIgnorePatterns: ['<rootDir>/dist/'],
|
||||
};
|
||||
|
@ -1,20 +1,12 @@
|
||||
module.exports = {
|
||||
// Automatically clear mock calls and instances between every test
|
||||
clearMocks: true,
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.js'],
|
||||
|
||||
// The directory where Jest should output its coverage files
|
||||
coverageDirectory: 'coverage',
|
||||
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/test/'],
|
||||
coverageReporters: ['lcov', 'text', 'clover'],
|
||||
errorOnDeprecated: true,
|
||||
|
||||
// An array of regexp pattern strings used to skip coverage collection
|
||||
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
|
||||
|
||||
// A list of reporter names that Jest uses when writing coverage reports
|
||||
coverageReporters: ['text', 'lcov'],
|
||||
|
||||
// The test environment that will be used for testing
|
||||
testEnvironment: 'jsdom',
|
||||
|
||||
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
||||
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
|
||||
testPathIgnorePatterns: ['<rootDir>/dist/'],
|
||||
};
|
||||
|
@ -19,7 +19,6 @@ const rootContext = {
|
||||
client,
|
||||
// appGraphql,
|
||||
message,
|
||||
document,
|
||||
openidLogoutUrl,
|
||||
user,
|
||||
};
|
||||
|
@ -56,7 +56,6 @@ const rootContext = {
|
||||
document,
|
||||
openidLogoutUrl,
|
||||
user,
|
||||
window,
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
|
@ -9,19 +9,13 @@ const mockMessageSuccess = jest.fn();
|
||||
const mockMessageError = jest.fn();
|
||||
const message = { loading: () => jest.fn(), error: mockMessageError, success: mockMessageSuccess };
|
||||
|
||||
const branch = 'master';
|
||||
const openidLogoutUrl = 'logout';
|
||||
const pageId = 'one';
|
||||
const user = { firstName: 'ABC' };
|
||||
|
||||
const rootContext = {
|
||||
branch,
|
||||
client,
|
||||
message,
|
||||
document,
|
||||
openidLogoutUrl,
|
||||
user,
|
||||
window,
|
||||
};
|
||||
|
||||
test('SetGlobal data to global', async () => {
|
||||
|
@ -19,7 +19,6 @@ const rootContext = {
|
||||
client,
|
||||
// appGraphql,
|
||||
message,
|
||||
document,
|
||||
openidLogoutUrl,
|
||||
user,
|
||||
};
|
||||
|
@ -9,7 +9,6 @@ const client = { writeFragment: jest.fn() };
|
||||
const rootContext = {
|
||||
branch,
|
||||
client,
|
||||
window,
|
||||
};
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
|
@ -1,20 +1,11 @@
|
||||
module.exports = {
|
||||
// Automatically clear mock calls and instances between every test
|
||||
clearMocks: true,
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.js'],
|
||||
|
||||
// The directory where Jest should output its coverage files
|
||||
coverageDirectory: 'coverage',
|
||||
|
||||
// An array of regexp pattern strings used to skip coverage collection
|
||||
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
|
||||
|
||||
// A list of reporter names that Jest uses when writing coverage reports
|
||||
coverageReporters: ['text'],
|
||||
|
||||
// The test environment that will be used for testing
|
||||
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/test/'],
|
||||
coverageReporters: ['lcov', 'text', 'clover'],
|
||||
errorOnDeprecated: true,
|
||||
testEnvironment: 'node',
|
||||
|
||||
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
||||
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
|
||||
testPathIgnorePatterns: ['<rootDir>/dist/'],
|
||||
};
|
||||
|
@ -1,20 +1,11 @@
|
||||
module.exports = {
|
||||
// Automatically clear mock calls and instances between every test
|
||||
clearMocks: true,
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.js'],
|
||||
|
||||
// The directory where Jest should output its coverage files
|
||||
coverageDirectory: 'coverage',
|
||||
|
||||
// An array of regexp pattern strings used to skip coverage collection
|
||||
coveragePathIgnorePatterns: ['/dist/'],
|
||||
|
||||
// A list of reporter names that Jest uses when writing coverage reports
|
||||
coverageReporters: ['text'],
|
||||
|
||||
// The test environment that will be used for testing
|
||||
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/test/'],
|
||||
coverageReporters: ['lcov', 'text', 'clover'],
|
||||
errorOnDeprecated: true,
|
||||
testEnvironment: 'node',
|
||||
|
||||
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
||||
testPathIgnorePatterns: ['/dist/'],
|
||||
testPathIgnorePatterns: ['<rootDir>/dist/'],
|
||||
};
|
||||
|
@ -1,21 +1,11 @@
|
||||
module.exports = {
|
||||
// Automatically clear mock calls and instances between every test
|
||||
clearMocks: true,
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.js'],
|
||||
|
||||
// The directory where Jest should output its coverage files
|
||||
coverageDirectory: 'coverage',
|
||||
|
||||
// An array of regexp pattern strings used to skip coverage collection
|
||||
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/src/test'],
|
||||
|
||||
// A list of reporter names that Jest uses when writing coverage reports
|
||||
coverageReporters: ['lcov', 'text'],
|
||||
coverageReporters: ['lcov', 'text', 'clover'],
|
||||
errorOnDeprecated: true,
|
||||
// The test environment that will be used for testing
|
||||
testEnvironment: 'node',
|
||||
|
||||
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
||||
testPathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/src/test'],
|
||||
};
|
||||
|
@ -1,20 +1,11 @@
|
||||
module.exports = {
|
||||
// Automatically clear mock calls and instances between every test
|
||||
clearMocks: true,
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.js'],
|
||||
|
||||
// The directory where Jest should output its coverage files
|
||||
coverageDirectory: 'coverage',
|
||||
|
||||
// An array of regexp pattern strings used to skip coverage collection
|
||||
coveragePathIgnorePatterns: ['/dist/'],
|
||||
|
||||
// A list of reporter names that Jest uses when writing coverage reports
|
||||
coverageReporters: ['text'],
|
||||
|
||||
// The test environment that will be used for testing
|
||||
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/test/'],
|
||||
coverageReporters: ['lcov', 'text', 'clover'],
|
||||
errorOnDeprecated: true,
|
||||
testEnvironment: 'node',
|
||||
|
||||
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
||||
testPathIgnorePatterns: ['/dist/'],
|
||||
testPathIgnorePatterns: ['<rootDir>/dist/'],
|
||||
};
|
||||
|
18
packages/layout/jest.config.js
Normal file
18
packages/layout/jest.config.js
Normal file
@ -0,0 +1,18 @@
|
||||
module.exports = {
|
||||
clearMocks: true,
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.{js,jsx}', '!demo/*'],
|
||||
coverageDirectory: 'coverage',
|
||||
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/tests/'],
|
||||
coverageReporters: ['lcov', 'text', 'clover'],
|
||||
errorOnDeprecated: true,
|
||||
testPathIgnorePatterns: ['<rootDir>/dist/'],
|
||||
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node', 'yaml', 'css'],
|
||||
moduleNameMapper: {
|
||||
'\\.(css|less)$': '<rootDir>/tests/__mocks__/styleMock.js',
|
||||
},
|
||||
transform: {
|
||||
'\\.yaml$': 'yaml-jest',
|
||||
'\\.js?$': 'babel-jest',
|
||||
},
|
||||
};
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"moduleFileExtensions": ["js", "json", "jsx", "ts", "tsx", "node", "yaml", "css"],
|
||||
"transform": {
|
||||
"\\.yaml$": "yaml-jest",
|
||||
"\\.js?$": "babel-jest"
|
||||
},
|
||||
"moduleNameMapper": {
|
||||
"\\.(css|less)$": "<rootDir>/tests/__mocks__/styleMock.js"
|
||||
},
|
||||
"collectCoverageFrom": ["src/**/*.{js,jsx}", "!demo/*"]
|
||||
}
|
@ -28,7 +28,7 @@
|
||||
"scripts": {
|
||||
"start": "webpack serve",
|
||||
"build": "babel src --out-dir dist",
|
||||
"test": "jest --coverage --config jest.config.json --no-cache",
|
||||
"test": "jest --coverage",
|
||||
"prepare": "yarn build",
|
||||
"prepublishOnly": "yarn build",
|
||||
"npm-publish": "npm publish --access public"
|
||||
@ -68,4 +68,4 @@
|
||||
"yaml-jest": "1.0.5",
|
||||
"yaml-loader": "0.6.0"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,20 +1,11 @@
|
||||
module.exports = {
|
||||
// Automatically clear mock calls and instances between every test
|
||||
clearMocks: true,
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.js'],
|
||||
|
||||
// The directory where Jest should output its coverage files
|
||||
coverageDirectory: 'coverage',
|
||||
|
||||
// An array of regexp pattern strings used to skip coverage collection
|
||||
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
|
||||
|
||||
// A list of reporter names that Jest uses when writing coverage reports
|
||||
coverageReporters: ['text'],
|
||||
|
||||
// The test environment that will be used for testing
|
||||
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/test/'],
|
||||
coverageReporters: ['lcov', 'text', 'clover'],
|
||||
errorOnDeprecated: true,
|
||||
testEnvironment: 'node',
|
||||
|
||||
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
||||
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
|
||||
testPathIgnorePatterns: ['<rootDir>/dist/'],
|
||||
};
|
||||
|
@ -1,20 +1,11 @@
|
||||
module.exports = {
|
||||
// Automatically clear mock calls and instances between every test
|
||||
clearMocks: true,
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.js'],
|
||||
|
||||
// The directory where Jest should output its coverage files
|
||||
coverageDirectory: 'coverage',
|
||||
|
||||
// An array of regexp pattern strings used to skip coverage collection
|
||||
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
|
||||
|
||||
// A list of reporter names that Jest uses when writing coverage reports
|
||||
coverageReporters: ['text'],
|
||||
|
||||
// The test environment that will be used for testing
|
||||
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/test/'],
|
||||
coverageReporters: ['lcov', 'text', 'clover'],
|
||||
errorOnDeprecated: true,
|
||||
testEnvironment: 'node',
|
||||
|
||||
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
||||
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
|
||||
testPathIgnorePatterns: ['<rootDir>/dist/'],
|
||||
};
|
||||
|
@ -1,20 +1,11 @@
|
||||
module.exports = {
|
||||
// Automatically clear mock calls and instances between every test
|
||||
clearMocks: true,
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.js'],
|
||||
|
||||
// The directory where Jest should output its coverage files
|
||||
coverageDirectory: 'coverage',
|
||||
|
||||
// An array of regexp pattern strings used to skip coverage collection
|
||||
coveragePathIgnorePatterns: ['/dist/'],
|
||||
|
||||
// A list of reporter names that Jest uses when writing coverage reports
|
||||
coverageReporters: ['text'],
|
||||
|
||||
// The test environment that will be used for testing
|
||||
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/test/'],
|
||||
coverageReporters: ['lcov', 'text', 'clover'],
|
||||
errorOnDeprecated: true,
|
||||
testEnvironment: 'node',
|
||||
|
||||
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
||||
testPathIgnorePatterns: ['/dist/'],
|
||||
testPathIgnorePatterns: ['<rootDir>/dist/'],
|
||||
};
|
||||
|
@ -1,20 +1,11 @@
|
||||
module.exports = {
|
||||
// Automatically clear mock calls and instances between every test
|
||||
clearMocks: true,
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.js'],
|
||||
|
||||
// The directory where Jest should output its coverage files
|
||||
coverageDirectory: 'coverage',
|
||||
|
||||
// An array of regexp pattern strings used to skip coverage collection
|
||||
coveragePathIgnorePatterns: ['/dist/'],
|
||||
|
||||
// A list of reporter names that Jest uses when writing coverage reports
|
||||
coverageReporters: ['text'],
|
||||
|
||||
// The test environment that will be used for testing
|
||||
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/test/'],
|
||||
coverageReporters: ['lcov', 'text', 'clover'],
|
||||
errorOnDeprecated: true,
|
||||
testEnvironment: 'node',
|
||||
|
||||
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
||||
testPathIgnorePatterns: ['/dist/'],
|
||||
testPathIgnorePatterns: ['<rootDir>/dist/'],
|
||||
};
|
||||
|
@ -1,20 +1,11 @@
|
||||
module.exports = {
|
||||
// Automatically clear mock calls and instances between every test
|
||||
clearMocks: true,
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.js'],
|
||||
|
||||
// The directory where Jest should output its coverage files
|
||||
coverageDirectory: 'coverage',
|
||||
|
||||
// An array of regexp pattern strings used to skip coverage collection
|
||||
coveragePathIgnorePatterns: ['/dist/'],
|
||||
|
||||
// A list of reporter names that Jest uses when writing coverage reports
|
||||
coverageReporters: ['text'],
|
||||
|
||||
// The test environment that will be used for testing
|
||||
coveragePathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/test/'],
|
||||
coverageReporters: ['lcov', 'text', 'clover'],
|
||||
errorOnDeprecated: true,
|
||||
testEnvironment: 'node',
|
||||
|
||||
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
||||
testPathIgnorePatterns: ['/dist/'],
|
||||
testPathIgnorePatterns: ['<rootDir>/dist/'],
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user