Skip to content

Commit 48aec5a

Browse files
committed
chore: initial setup
1 parent b8a59b1 commit 48aec5a

21 files changed

+306
-0
lines changed

.commitlintrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {},
4+
};

.czrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "./node_modules/cz-conventional-changelog"
3+
}

.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = true
9+
max_line_length = 100
10+
tab_width = 2
11+
trim_trailing_whitespace = true

.eslintrc

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"node": true,
5+
"jest": true
6+
},
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/eslint-recommended",
10+
"plugin:@typescript-eslint/recommended",
11+
"plugin:import/recommended",
12+
"plugin:import/typescript",
13+
"plugin:unicorn/all",
14+
"plugin:jsdoc/recommended",
15+
"plugin:node/recommended",
16+
"plugin:prettier/recommended"
17+
],
18+
"ignorePatterns": [
19+
"coverage",
20+
"dist",
21+
"website",
22+
"jest.config.js"
23+
],
24+
"parser": "@typescript-eslint/parser",
25+
"parserOptions": {
26+
"project": "__tests__/tsconfig.json"
27+
},
28+
"plugins": [
29+
"no-only-tests"
30+
],
31+
"rules": {
32+
"import/extensions": [
33+
2,
34+
"ignorePackages",
35+
{
36+
"js": "never",
37+
"jsx": "never",
38+
"ts": "never",
39+
"tsx": "never"
40+
}
41+
],
42+
"import/no-duplicates": "off",
43+
"import/no-unresolved": 2,
44+
"node/no-missing-import": "off",
45+
"node/no-unsupported-features/es-syntax": "off",
46+
"@typescript-eslint/member-ordering": "error",
47+
"unicorn/filename-case": "off",
48+
"unicorn/import-style": "off",
49+
"unicorn/prefer-node-protocol": "off",
50+
"unicorn/prefer-string-replace-all": "off",
51+
"unicorn/no-unused-properties": "off",
52+
"unicorn/prefer-module": "off"
53+
},
54+
"settings": {
55+
"import/resolver": {
56+
"typescript": {
57+
"project": "__tests__"
58+
}
59+
}
60+
},
61+
"overrides": [
62+
{
63+
"files": ["**/__tests__/*.ts", "*.test.ts"],
64+
"rules": {
65+
"@typescript-eslint/no-explicit-any": "off",
66+
"no-only-tests/no-only-tests": "error"
67+
}
68+
}
69+
]
70+
}

.gitignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/tmp
2+
/node_modules
3+
package-lock.json
4+
yarn.lock
5+
/npm-debug.log
6+
/examples/*.log
7+
/examples/*.json
8+
9+
*.log
10+
11+
.DS_Store
12+
.idea
13+
.vscode
14+
15+
/coverage
16+
/website
17+
/dist
18+
/jest-allure2-reporter-*.tgz

.lintstagedrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"*.{js,ts}": ["eslint --fix", "jest --bail --findRelatedTests"]
3+
}

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/gallium

.prettierrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"printWidth": 100,
3+
"tabWidth": 2,
4+
"tabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "all",
8+
"bracketSpacing": true,
9+
"arrowParens": "always"
10+
}

.releaserc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"branches": ["master", "next"]
3+
}

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# jest-allure2-reporter
2+
3+
[![npm version](https://badge.fury.io/js/jest-allure2-reporter.svg)](https://badge.fury.io/js/jest-allure2-reporter)
4+
[![CI](https://github.com/wix-incubator/jest-allure2-reporter/actions/workflows/ci.yml/badge.svg)](https://github.com/wix-incubator/jest-allure2-reporter/actions/workflows/ci.yml)
5+
[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
6+
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
7+
8+
TODO
9+
10+
## License
11+
12+
[MIT License](LICENSE)

jest.config.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/** @type {import('@jest/types').Config} */
2+
module.exports = {
3+
preset: 'ts-jest',
4+
testEnvironment: 'node',
5+
testMatch: ['<rootDir>/test/**/*.test.{js,ts}'],
6+
globals: {
7+
'ts-jest': {
8+
tsconfig: '__tests__/tsconfig.json'
9+
}
10+
}
11+
};

package.json

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"name": "jest-allure2-reporter",
3+
"version": "1.0.0",
4+
"description": "TODO: describe reporter",
5+
"license": "MIT",
6+
"keywords": [
7+
"allure",
8+
"allure2",
9+
"jest",
10+
"jest-reporter",
11+
"reporter"
12+
],
13+
"authors": [
14+
"Yaroslav Serhieiev <[email protected]>"
15+
],
16+
"repository": {
17+
"url": "github:wix-incubator/jest-allure2-reporter"
18+
},
19+
"engines": {
20+
"node": ">=14.0.0"
21+
},
22+
"main": "./dist/index.js",
23+
"typings": "./dist/index.d.ts",
24+
"files": [
25+
"src",
26+
"dist"
27+
],
28+
"scripts": {
29+
"prepare": "husky install && npm run build",
30+
"build": "tsc",
31+
"docs": "typedoc && cp -r media website",
32+
"website": "http-server -p 3000 website",
33+
"lint": "eslint . --fix",
34+
"lint:ci": "eslint .",
35+
"lint:staged": "lint-staged",
36+
"test": "jest",
37+
"test:ci": "jest --coverage"
38+
},
39+
"devDependencies": {
40+
"@commitlint/cli": "^17.0.3",
41+
"@commitlint/config-conventional": "^17.0.3",
42+
"@jest/environment": "^28.1.2",
43+
"@jest/types": "^28.1.1",
44+
"@types/jest": "^28.1.3",
45+
"@types/node": "^12.20.55",
46+
"@typescript-eslint/eslint-plugin": "^5.29.0",
47+
"@typescript-eslint/parser": "^5.29.0",
48+
"cz-conventional-changelog": "^3.3.0",
49+
"eslint": "^8.18.0",
50+
"eslint-config-prettier": "^8.5.0",
51+
"eslint-import-resolver-typescript": "^3.1.1",
52+
"eslint-plugin-import": "^2.26.0",
53+
"eslint-plugin-jsdoc": "^39.3.3",
54+
"eslint-plugin-no-only-tests": "^2.6.0",
55+
"eslint-plugin-node": "^11.1.0",
56+
"eslint-plugin-prettier": "^4.1.0",
57+
"eslint-plugin-unicorn": "^42.0.0",
58+
"fs-extra": "^10.1.0",
59+
"husky": "^8.0.1",
60+
"jest": "^28.1.1",
61+
"jest-environment-node": "^28.1.2",
62+
"lint-staged": "^13.0.3",
63+
"prettier": "^2.7.1",
64+
"semantic-release": "^19.0.3",
65+
"ts-jest": "^28.0.5",
66+
"ts-node": "^10.8.1",
67+
"typedoc": "^0.22.18",
68+
"typescript": "~4.3.5",
69+
"zx": "^7.0.3"
70+
},
71+
"dependencies": {}
72+
}

src/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export class JestAllure2Reporter {
2+
}

test/nested-suite.test.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
describe('Grand parent suite', () => {
2+
beforeAll(async () => {
3+
console.log('Grand parent suite: beforeAll');
4+
// await device.launchApp();
5+
});
6+
7+
describe('Parent suite', () => {
8+
describe('Child suite', () => {
9+
beforeAll(async () => {
10+
console.log('Child suite: beforeAll');
11+
// await device.sendToHome();
12+
});
13+
14+
test.todo('Test 1 (todo)');
15+
16+
test('Test 2', async () => {
17+
console.log('Test 2: test_fn');
18+
// await device.launchApp();
19+
});
20+
21+
test.skip('Test 3 (skip)', async () => {
22+
console.log('Test 3: test_fn');
23+
});
24+
25+
test('Test 4', async () => {
26+
console.log('Test 4: test_fn');
27+
// await device.terminateApp();
28+
});
29+
});
30+
31+
afterAll(async () => {
32+
console.log('Parent suite: afterAll');
33+
// throw new Error('Parent suite error');
34+
});
35+
});
36+
});

test/root-test-pass.test.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test('launch app', async () => {
2+
// await device.launchApp();
3+
});

test/root-test-skip.test.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test.skip('launch app', async () => {
2+
await device.launchApp();
3+
});

test/simple-suite-pass.test.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('Suite', () => {
2+
test('launch app', async () => {
3+
// await device.launchApp();
4+
});
5+
});

test/simple-suite-skip.test.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe.skip('Suite', () => {
2+
test('launch app', async () => {
3+
// await device.launchApp();
4+
});
5+
});

tsconfig.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2018",
4+
"module": "commonjs",
5+
"declaration": true,
6+
"sourceMap": true,
7+
"outDir": "./dist",
8+
"rootDir": "./src",
9+
"importHelpers": false,
10+
"strict": true,
11+
"noImplicitAny": true,
12+
"strictNullChecks": true,
13+
"strictFunctionTypes": true,
14+
"strictPropertyInitialization": true,
15+
"noImplicitThis": true,
16+
"alwaysStrict": true,
17+
"noUnusedLocals": true,
18+
"noUnusedParameters": true,
19+
"noImplicitReturns": true,
20+
"noFallthroughCasesInSwitch": true,
21+
"esModuleInterop": true,
22+
"skipLibCheck": true
23+
},
24+
"include": [
25+
"src/**/*.ts"
26+
]
27+
}

typedoc.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"entryPoints": ["src/index.ts"],
3+
"hideGenerator": true,
4+
"name": "@wix-incubator/jest-allure2-reporter",
5+
"out": "website"
6+
}

0 commit comments

Comments
 (0)