Skip to content

Commit

Permalink
fix: Get QUnit tests not included in a module
Browse files Browse the repository at this point in the history
* ci: Update actions

* fix: Get QUnit tests not included in a module

* test: Include more test scenarios

* chore: Bump deps
  • Loading branch information
mauriciolauffer authored Jun 6, 2024
1 parent 48c10ba commit fcecb15
Show file tree
Hide file tree
Showing 69 changed files with 4,815 additions and 3,150 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extends:
env:
mocha: true
qunit: true
parser: '@typescript-eslint/parser'
parser: "@typescript-eslint/parser"
rules:
jsdoc/require-param: off
jsdoc/require-returns: off
34 changes: 17 additions & 17 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name: "CodeQL"

on:
push:
branches: [ main ]
branches: [main]
pull_request:

permissions: read-all
Expand All @@ -28,25 +28,25 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
1 change: 0 additions & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
cache: npm
- run: npm ci --ignore-scripts
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches: [main]


permissions: read-all

jobs:
Expand All @@ -13,8 +12,7 @@ jobs:
contents: write
pull-requests: write
steps:
- uses: google-github-actions/release-please-action@v3
- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.GH_PAT }}
release-type: node
package-name: wdio-qunit-service
4 changes: 2 additions & 2 deletions .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ on:
# Only the default branch is supported.
branch_protection_rule:
schedule:
- cron: '10 5 * * 1'
- cron: "10 5 * * 1"
push:
branches: [ main ]
branches: [main]

# Declare default permissions as read only.
permissions: read-all
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: test

on:
push:
branches: [ main ]
branches: [main]
pull_request:

permissions: read-all
Expand All @@ -13,17 +13,17 @@ jobs:
permissions:
security-events: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci --ignore-scripts
- run: npm run build
- run: npm run test:cjs
- run: npm run test:esm
- run: npm run test:features
- run: npm run lint:ci
- uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: eslint.sarif
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: npm
- run: npm ci --ignore-scripts
- run: npm run build
- run: npm run test:esm
- run: npm run test:features
- run: npm run test:qunit
# - run: npm run test:cjs
- run: npm run lint:ci
- uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: eslint.sarif
11 changes: 4 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@

## [0.1.1](https://github.com/mauriciolauffer/wdio-qunit-service/compare/v0.1.0...v0.1.1) (2023-11-30)


### Bug Fixes

* Nested QUnit Modules ([6fa35d6](https://github.com/mauriciolauffer/wdio-qunit-service/commit/6fa35d6d1ea2c72379acfc0ff7d9658e047e4c90))
- Nested QUnit Modules ([6fa35d6](https://github.com/mauriciolauffer/wdio-qunit-service/commit/6fa35d6d1ea2c72379acfc0ff7d9658e047e4c90))

## 0.1.0 (2023-10-13)


### Features

* QUnit completed ([704a63d](https://github.com/mauriciolauffer/wdio-qunit-service/commit/704a63d834fb301f18c436caa702a860608d127a))
* wdio qunit service ([d31b4d7](https://github.com/mauriciolauffer/wdio-qunit-service/commit/d31b4d7ef9f4765833a41a876cbb25901bbd20f7))

- QUnit completed ([704a63d](https://github.com/mauriciolauffer/wdio-qunit-service/commit/704a63d834fb301f18c436caa702a860608d127a))
- wdio qunit service ([d31b4d7](https://github.com/mauriciolauffer/wdio-qunit-service/commit/d31b4d7ef9f4765833a41a876cbb25901bbd20f7))

### Bug Fixes

* Version ([#1](https://github.com/mauriciolauffer/wdio-qunit-service/issues/1)) ([b793c55](https://github.com/mauriciolauffer/wdio-qunit-service/commit/b793c55ca99057a5674e4cf12c72b956e9904b5a))
- Version ([#1](https://github.com/mauriciolauffer/wdio-qunit-service/issues/1)) ([b793c55](https://github.com/mauriciolauffer/wdio-qunit-service/commit/b793c55ca99057a5674e4cf12c72b956e9904b5a))
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,32 @@ All submissions, including submissions by project members, require review. The p

1. Look through the existing issues and see if your idea is something new.
2. Create a new issue, or comment on an existing issue that you would like to help solve:
* it's usually best to get some feedback before proceeding to write code.
- it's usually best to get some feedback before proceeding to write code.
3. fork the repo, and clone it to your computer:
* GitHub has [great documentation](https://help.github.com/articles/using-pull-requests/) regarding writing your first pull request.
- GitHub has [great documentation](https://help.github.com/articles/using-pull-requests/) regarding writing your first pull request.
4. make sure that you write unit-test for any code that you write for the project:
* ESLint is the main SAST tool in this project.
* look through the test suite in `/test` folder to get an idea for how to write unit-tests for this codebase.
- ESLint is the main SAST tool in this project.
- look through the test suite in `/test` folder to get an idea for how to write unit-tests for this codebase.

## Before you begin

1. [Install Node.js LTS](https://nodejs.org/en/).

### How to test

1. Install dependencies:
1. Install dependencies:

npm ci

2. Build:
2. Build:

npm run build

3. Lint the codebase:
3. Lint the codebase:

npm run lint

4. Run the tests:
4. Run the tests:

npm test

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ In order to use `QUnit Service` you just need to add it to the `services` list i

```js
export const config = {
// ...
services: ['qunit'],
// ...
// ...
services: ["qunit"],
// ...
};
```

Expand All @@ -41,9 +41,9 @@ export const config = {
In your WebdriverIO test, you need to navigate to the QUnit HTML test page, then call `browser.getQUnitResults()`.

```js
describe('QUnit test page', () => {
it('should pass QUnit tests', async () => {
await browser.url('http://localhost:8080/test/unit/unitTests.qunit.html');
describe("QUnit test page", () => {
it("should pass QUnit tests", async () => {
await browser.url("http://localhost:8080/test/unit/unitTests.qunit.html");
const qunitResults = await browser.getQUnitResults();
expect(qunitResults).toBeTruthy();
});
Expand Down
32 changes: 16 additions & 16 deletions examples/openui5-sample-app/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "openui5-sample-app",
"version": "0.4.0",
"description": "Sample of an OpenUI5 app",
"private": true,
"type": "module",
"scripts": {
"start": "ui5 serve",
"test": "wdio run ./webapp/test/wdio.conf.js"
},
"devDependencies": {
"@wdio/cli": "^8",
"@wdio/local-runner": "^8",
"@wdio/mocha-framework": "^8",
"@wdio/spec-reporter": "^8",
"wdio-qunit-service": "*"
}
"name": "openui5-sample-app",
"version": "0.4.0",
"description": "Sample of an OpenUI5 app",
"private": true,
"type": "module",
"scripts": {
"start": "ui5 serve",
"test": "wdio run ./webapp/test/wdio.conf.js"
},
"devDependencies": {
"@wdio/cli": "^8",
"@wdio/local-runner": "^8",
"@wdio/mocha-framework": "^8",
"@wdio/spec-reporter": "^8",
"wdio-qunit-service": "*"
}
}
2 changes: 1 addition & 1 deletion examples/openui5-sample-app/ui5.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
specVersion: '3.1'
specVersion: "3.1"
metadata:
name: openui5-sample-app
type: application
Expand Down
19 changes: 11 additions & 8 deletions examples/openui5-sample-app/webapp/Component.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
sap.ui.define(["sap/ui/core/UIComponent", "sap/ui/core/ComponentSupport"], (UIComponent) => {
"use strict";
return UIComponent.extend("sap.ui.demo.todo.Component", {
metadata: {
manifest: "json"
}
});
});
sap.ui.define(
["sap/ui/core/UIComponent", "sap/ui/core/ComponentSupport"],
(UIComponent) => {
"use strict";
return UIComponent.extend("sap.ui.demo.todo.Component", {
metadata: {
manifest: "json",
},
});
}
);
Loading

0 comments on commit fcecb15

Please sign in to comment.