Skip to content

Commit 54ffc6a

Browse files
committed
fix: first release
0 parents  commit 54ffc6a

13 files changed

+413
-0
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CHANGELOG.md

.eslintrc.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
commonjs: true,
5+
es6: true,
6+
mocha: true
7+
},
8+
extends: [
9+
'airbnb-base',
10+
],
11+
globals: {
12+
Atomics: 'readonly',
13+
SharedArrayBuffer: 'readonly',
14+
},
15+
parserOptions: {
16+
ecmaVersion: 2018,
17+
},
18+
rules: {
19+
"no-underscore-dangle": [2, { "allow": ["_updateBuild", "_exposeBuildLink", "_shortenUrl", "_passed", "_failed", "_getSessionId"] }],
20+
'class-methods-use-this': ["error", { "exceptMethods": ["_shortenUrl"] }],
21+
'no-console': [0]
22+
},
23+
};

.github/main.workflow

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
workflow "build and test" {
2+
on = "push"
3+
resolves = ["test"]
4+
}
5+
6+
action "build" {
7+
uses = "actions/npm@master"
8+
args = "ci"
9+
}
10+
11+
action "test" {
12+
needs = "build"
13+
uses = "actions/npm@master"
14+
args = "t"
15+
}
16+
17+
workflow "publish on release" {
18+
on = "release"
19+
resolves = ["publish"]
20+
}
21+
22+
action "publish" {
23+
uses = "actions/npm@master"
24+
args = "publish"
25+
secrets = ["NPM_AUTH_TOKEN"]
26+
}

.github/workflows/nodejs.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Unit tests
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
node-version: [16.x]
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- name: run unit tests
21+
run: |
22+
npm i
23+
npm test

.github/workflows/npmpublish.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: NPM publish
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
9+
jobs:
10+
publish-npm:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: 16
17+
registry-url: https://registry.npmjs.org/
18+
- run: npm i
19+
- run: npm run build
20+
- run: npx semantic-release
21+
env:
22+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
23+
GH_TOKEN: ${{ secrets.GH_TOKEN }}

.gitignore

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (https://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# TypeScript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# Yarn Integrity file
55+
.yarn-integrity
56+
57+
# dotenv environment variables file
58+
.env
59+
60+
# next.js build output
61+
.next
62+
63+
.DS_Store
64+
65+
package-lock.json
66+
67+
.idea/*
68+
69+
dist/*

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 kobenguyent
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/peternguyew)
2+
[![GitHub tag](https://img.shields.io/github/tag/kobenguyent/codeceptjs-failure-logger?include_prereleases=&sort=semver&color=green)](https://github.com/kobenguyent/codeceptjs-loggers-plugin/releases/)
3+
4+
## CodeceptJS Failure Logger
5+
6+
The CodeceptJS Failure Logger is a module that captures and logs test failures in CodeceptJS. When a test fails, the module appends the relevant information to a specified output file.
7+
8+
### Installation
9+
10+
To install the CodeceptJS Failure Logger module, you can use npm:
11+
12+
```bash
13+
npm install codeceptjs-failure-logger
14+
```
15+
16+
### Configuration
17+
18+
The CodeceptJS Failure Logger module can be configured by passing an object with the following properties:
19+
20+
- `outputDir` (optional): The directory where the output file will be stored. If not provided, it uses the CodeceptJS default output directory.
21+
- `fileName` (optional): The name of the output file. If not provided, it defaults to 'failures.txt'. The file extension should be '.txt'.
22+
23+
Example usage with configuration:
24+
25+
```
26+
{
27+
...
28+
plugins: {
29+
Logger: {
30+
require: 'codeceptjs-failure-logger',
31+
enabled: true,
32+
outputDir: './logs',
33+
fileName: 'test_failures.txt'
34+
}
35+
}
36+
...
37+
}
38+
```
39+
40+
Now, whenever a test fails, the failure details will be appended to the 'test_failures.txt' file in the 'logs' directory.
41+
42+
43+

commitlint.config.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module.exports = {
2+
parserPreset: 'conventional-changelog-conventionalcommits',
3+
rules: {
4+
'body-leading-blank': [1, 'always'],
5+
'footer-leading-blank': [1, 'always'],
6+
'header-max-length': [2, 'always', 72],
7+
'scope-case': [2, 'always', 'lower-case'],
8+
'subject-case': [
9+
2,
10+
'never',
11+
['sentence-case', 'start-case', 'pascal-case', 'upper-case'],
12+
],
13+
'subject-empty': [2, 'never'],
14+
'subject-full-stop': [2, 'never', '.'],
15+
'type-case': [2, 'always', 'lower-case'],
16+
'type-empty': [2, 'never'],
17+
'type-enum': [
18+
2,
19+
'always',
20+
[
21+
'build',
22+
'chore',
23+
'ci',
24+
'docs',
25+
'feat',
26+
'fix',
27+
'improvement',
28+
'perf',
29+
'refactor',
30+
'revert',
31+
'style',
32+
'test',
33+
],
34+
],
35+
},
36+
};

package.json

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
"name": "codeceptjs-failure-logger",
3+
"version": "1.0.0",
4+
"description": "Logging for CodeceptJS failed tests",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/kobenguyent/codeceptjs-failure-logger.git"
8+
},
9+
"scripts": {
10+
"test": "nyc mocha -r ts-node/register test/**/*_test.ts --timeout 10000",
11+
"semantic-release": "semantic-release",
12+
"build": "tsc"
13+
},
14+
"keywords": [
15+
"codeceptJS",
16+
"codeceptjs",
17+
"logging",
18+
"codeceptjs-loggers"
19+
],
20+
"author": "kobenguyent <kobenguyent@gmail.com>",
21+
"license": "MIT",
22+
"bugs": {
23+
"url": "https://github.com/kobenguyent/codeceptjs-failure-logger/issues"
24+
},
25+
"homepage": "https://github.com/kobenguyent/codeceptjs-failure-logger#readme",
26+
"main": "dist/src/index.js",
27+
"types": "dist/src/index.d.ts",
28+
"devDependencies": {
29+
"@commitlint/cli": "11.0.0",
30+
"@commitlint/config-conventional": "11.0.0",
31+
"@istanbuljs/nyc-config-typescript": "^1.0.2",
32+
"@types/mocha": "^9.1.0",
33+
"@types/node": "^14.18.52",
34+
"codeceptjs": "^3.3.0",
35+
"eslint": "^6.6.0",
36+
"eslint-config-airbnb-base": "^14.0.0",
37+
"eslint-plugin-import": "^2.18.2",
38+
"husky": "^4.0.2",
39+
"mocha": "^9.2.1",
40+
"nyc": "^15.1.0",
41+
"semantic-release": "^19.0.2",
42+
"standard-version": "^9.1.1",
43+
"ts-node": "^10.5.0"
44+
},
45+
"files": [
46+
"dist/*"
47+
],
48+
"peerDependencies": {
49+
"codeceptjs": "^3.4.1"
50+
},
51+
"dependencies": {
52+
"axios": "^0.21.1",
53+
"chalk": "^4.1.0",
54+
"expect": "^29.5.0",
55+
"format-json": "^1.0.3",
56+
"tinyurl": "^1.1.4",
57+
"typescript": "^4.5.5"
58+
},
59+
"config": {
60+
"commitizen": {
61+
"path": "cz-conventional-changelog"
62+
}
63+
},
64+
"husky": {
65+
"hooks": {
66+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
67+
}
68+
},
69+
"nyc": {
70+
"extends": "@istanbuljs/nyc-config-typescript",
71+
"lines": 40,
72+
"check-coverage": true,
73+
"all": true,
74+
"include": [
75+
"src/**/!(*.test.*).[tj]s?(x)"
76+
],
77+
"exclude": [
78+
"src/_tests_/**/*.*"
79+
],
80+
"reporter": [
81+
"html",
82+
"lcov",
83+
"text",
84+
"text-summary"
85+
],
86+
"report-dir": "coverage"
87+
}
88+
}

0 commit comments

Comments
 (0)