Skip to content

Commit

Permalink
chore: Add GitHub workflow
Browse files Browse the repository at this point in the history
- Use the minimum supported version of Node.js
- Configure yarn and .gitignore
- Remove compiled **.js** files
- Use a consistent Mocha UI interface/style
- Remove tests that do not exercise the module's behaviour
- Resolve problems reported by TypeScript
  • Loading branch information
seanpoulter committed Mar 27, 2024
1 parent bdbab98 commit 1f4870f
Show file tree
Hide file tree
Showing 16 changed files with 83 additions and 861 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: CI

on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['16']
steps:
- uses: actions/checkout@v4
- name: Use Node.js v${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn run build
- name: Run Tests
run: |
yarn run test
yarn run test:invalid
yarn run test:reporter
timeout-minutes: 10
17 changes: 14 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
# yarn
# See https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored.
.pnp.*
.yarnclean
.yarn/cache
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# npm packages
node_modules

build
build-test
dist
.idea
reports
node_modules
*.log
package-lock.json
lib
lib-test
.idea
2 changes: 1 addition & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"require": "./register.js",
"reporter": "spec",
"ui": "tdd"
"ui": "bdd"
}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.20.2
Binary file removed .yarn/install-state.gz
Binary file not shown.
2 changes: 0 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
nodeLinker: node-modules

yarnPath: /users/rpii/.yarn/releases/yarn-3.6.1.cjs
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# wdio-html-nice-reporter
# wdio-html-nice-reporter

A reporter for webdriver.io which generates a nice HTML report.
The name is silly but provides integration with webdriverio
Expand All @@ -12,7 +12,7 @@ Note: if you are not getting your report generated in the cucumber or jasmine te
"report": "node node_modules/wdio-html-nice-reporter/lib/makeReport.js master-report.html 'reports/html-reports/'",
```
If you do this you do not need to create a ReportAggregator in your wdio.config.ts
### Bug fix: json write wasnt awaited for correctly
### Bug fix: json write was not awaited for correctly

### Great new improvement: no more out of memory errors due to json.stringify

Expand Down Expand Up @@ -103,7 +103,7 @@ onComplete: function (exitCode, config, capabilities, results) {
### To use a logger for debugging

A new feature for developers is to add a log4js logger to see detailed debug output. See the test/reporter.spec.js for configuration options.
If you dont want to use the logging, include in your project @log4js-node/log4js-api and you can quiet all debugging.
If you don't want to use the logging, include in your project @log4js-node/log4js-api and you can quiet all debugging.
via:

const log4js = require('@log4js-node/log4js-api');
Expand All @@ -113,7 +113,7 @@ via:

### To generate a pdf file from this report

Requires an additional plugin to keep the support lightweight for those that dont want it.
Requires an additional plugin to keep the support lightweight for those that don't want it.
see [@rpii/wdio-html-reporter-pdf](https://www.npmjs.com/package/@rpii/wdio-html-reporter-pdf)


Expand All @@ -123,6 +123,4 @@ see [@rpii/wdio-html-reporter-pdf](https://www.npmjs.com/package/@rpii/wdio-html

## browserName

This must be set manually. Its not available at config time since the browser object doesnt exist until you start a session.


This must be set manually. It is not available at config time since the browser object doesn't exist until you start a session.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
"clean:build": "rimraf ./lib",
"clean:reports": "rimraf ./reports",
"clean:logs": "rimraf ./logs",
"test": "cd test ;tsc",
"test": "cd test; tsc",
"test:invalid": "mocha ./lib/test/invalid.test.spec.js",
"test:reporter": "mocha ./lib/test/reporter.spec.js",
"test:nested": "mocha ./test/nested.test.spec.ts"
"test:reporter": "mocha ./lib/test/reporter.spec.js"
},
"repository": {
"type": "git",
Expand Down
153 changes: 0 additions & 153 deletions test/invalid.test.spec.js

This file was deleted.

0 comments on commit 1f4870f

Please sign in to comment.