Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Use the ES modules directly #385

Merged
merged 2 commits into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
"node": true
},
"extends": "eslint:recommended",
"overrides": [{
"files": ["test/rollup.config.js"],
"parserOptions": {
"sourceType": "module"
"overrides": [
{
"files": ["test/test*.js"],
"parserOptions": {
"sourceType": "module"
}
}
}],
],
"parserOptions": {
"ecmaVersion": 2018
},
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"start:edge": "npm run start:_core -- --source-dir build/edge --target chromium --chromium-binary '/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge'",
"start:firefox": "npm run start:_core -- --source-dir build/firefox",
"start:opera": "npm run start:_core -- --source-dir build/opera --target chromium --chromium-binary /Applications/Opera.app/Contents/MacOS/opera",
"pretest": "eslint . && rollup -c test/rollup.config.js",
"test": "npx nyc --exclude 'test/test*js' --reporter text --reporter html ava && npm run test:css",
"pretest": "eslint .",
"test": "npx nyc --reporter text --reporter html ava && npm run test:css",
"test:css": "npx stylelint --config .stylelintrc.json src/**/*.css",
"version": "standard-version --tag-prefix="
},
Expand All @@ -23,12 +23,15 @@
"pre-commit": "npm run build:all"
}
},
"esm": { "cjs": true },
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check this is necessary.

"ava": {
"files": [
"!test/generated-*.js",
"!test/rollup.config.js"
]
],
"require": ["esm"]
},
"nyc": { "require": ["esm"] },
"devDependencies": {
"addons-linter": "^2.1.0",
"archiver-promise": "~1.0",
Expand All @@ -37,6 +40,7 @@
"deepmerge": "~4.2",
"dependency-tree": "^7.2.1",
"eslint": "^7.5.0",
"esm": "^3.2.25",
"fs-extra": "^9.0.1",
"husky": "^4.2.5",
"jsdom": "^16.3.0",
Expand Down
22 changes: 0 additions & 22 deletions test/rollup.config.js

This file was deleted.

5 changes: 2 additions & 3 deletions test/testContrastChecker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict'
const test = require('ava')
const ContrastChecker = require('./generated-contrast-checker.js')
import test from 'ava'
import ContrastChecker from '../src/code/contrastChecker'

const contrastChecker = new ContrastChecker()

Expand Down
9 changes: 4 additions & 5 deletions test/testLandmarksFinder.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use strict'
const test = require('ava')
const jsdom = require('jsdom')
const pssst = require('page-structural-semantics-scanner-tests')
const LandmarksFinder = require('./generated-landmarks-finder')
import test from 'ava'
import jsdom from 'jsdom'
import pssst from 'page-structural-semantics-scanner-tests'
import LandmarksFinder from '../src/code/landmarksFinder'

const { JSDOM } = jsdom
const checks = pssst.getFullPageTestsInline()
Expand Down
5 changes: 2 additions & 3 deletions test/testMigrationManager.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable no-prototype-builtins */
'use strict'
const test = require('ava')
const MigrationManager = require('./generated-migration-manager.js')
import test from 'ava'
import MigrationManager from '../src/code/migrationManager'

// The purpose of the migration manager is to delete obsolete user settings, or
// rename existing user settings to their current names. Landmarks ships with
Expand Down