Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
Fixes #10
sindresorhus committed Aug 20, 2024
1 parent 531fd87 commit d452be2
Showing 5 changed files with 16 additions and 12 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -10,12 +10,14 @@ jobs:
fail-fast: false
matrix:
node-version:
- 22
- 20
- 18
- 16
- 14
- 12
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -9,13 +9,13 @@ const domLoaded = new Promise(resolve => {
}, {
capture: true,
once: true,
passive: true
passive: true,
});
}
});

export default domLoaded;

Object.defineProperty(domLoaded, 'hasLoaded', {
get: () => hasLoaded()
get: () => hasLoaded(),
});
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -12,12 +12,14 @@
},
"type": "module",
"exports": "./index.js",
"types": "./index.d.ts",
"sideEffects": false,
"engines": {
"node": ">=12"
},
"scripts": {
"// TODO: Enable when JSOM support ESM - test": "xo && ava && tsd",
"test": "xo && tsd"
"test": "xo"
},
"files": [
"index.js",
@@ -38,7 +40,7 @@
"ava": "^3.15.0",
"jsdom": "^16.5.3",
"tsd": "^0.14.0",
"xo": "^0.39.1"
"xo": "^0.54.0"
},
"xo": {
"envs": [
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@ Unlike `DOMContentLoaded`, this also works when included after the DOM was loade

## Install

```
$ npm install dom-loaded
```sh
npm install dom-loaded
```

## Usage
6 changes: 3 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ const umdWrappedDomLoaded = `

test('works when included before `DOMContentLoaded` fired', async t => {
const {window} = new JSDOM('<body></body>', {
runScripts: 'outside-only'
runScripts: 'outside-only',
});

window.eval(umdWrappedDomLoaded);
@@ -33,7 +33,7 @@ test('works when included before `DOMContentLoaded` fired', async t => {

test('works when included after `DOMContentLoaded` fired', async t => {
const {window} = new JSDOM('<body></body>', {
runScripts: 'outside-only'
runScripts: 'outside-only',
});

const loadedPromise = new Promise(resolve => {
@@ -51,7 +51,7 @@ test('works when included after `DOMContentLoaded` fired', async t => {

test('domLoaded.hasLoaded', async t => {
const {window} = new JSDOM('<body></body>', {
runScripts: 'outside-only'
runScripts: 'outside-only',
});

const loadedPromise = new Promise(resolve => {

0 comments on commit d452be2

Please sign in to comment.