mirror of
https://github.com/Modernizr/Modernizr.git
synced 2026-01-06 22:33:53 -05:00
Update code coverage tooling (#2751)
* try to update code coverage tooling * split testing and coverage * cleanups * bump patched dependencies * fix jsdoc errors * undo node version bump * cleanup gitignore * fix script name
This commit is contained in:
26
.github/workflows/coverage.yml
vendored
Normal file
26
.github/workflows/coverage.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: Coverage
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- name: Installing Node ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
- name: Installing dependencies
|
||||
run: npm ci
|
||||
- name: Installing gulp command line interface
|
||||
run: npm install gulp-cli
|
||||
- name: Run tests with coverage
|
||||
run: npm run coverage:lcov
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
files: ./coverage/lcov.info
|
||||
token: ${{ secrets.CODECOV_TOKEN }} # required
|
||||
8
.github/workflows/testing.yml
vendored
8
.github/workflows/testing.yml
vendored
@@ -11,9 +11,9 @@ jobs:
|
||||
node-version: [16.x, 18.x, 20.x]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
- name: Installing Node ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: npm
|
||||
@@ -21,7 +21,5 @@ jobs:
|
||||
run: npm ci
|
||||
- name: Installing gulp command line interface
|
||||
run: npm install gulp-cli
|
||||
- name: Testing Modernizr
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
- name: Sending Coverage
|
||||
run: ./node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/codecov --pipe
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,8 +1,10 @@
|
||||
/coverage
|
||||
/dist
|
||||
/gh-pages
|
||||
/node_modules
|
||||
/test/coverage
|
||||
/test/*.html
|
||||
/.nyc_output
|
||||
modernizr.js
|
||||
metadata.json
|
||||
.DS_Store
|
||||
@@ -10,4 +12,3 @@ metadata.json
|
||||
.project
|
||||
*.log
|
||||
tmp
|
||||
/.nyc_output
|
||||
820
package-lock.json
generated
820
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@@ -52,7 +52,7 @@
|
||||
"lodash": "^4.17.21",
|
||||
"markdown-it": "^13.0.1",
|
||||
"mkdirp": "^3.0.1",
|
||||
"requirejs": "^2.3.6",
|
||||
"requirejs": "^2.3.7",
|
||||
"yargs": "^17.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -73,23 +73,25 @@
|
||||
"gulp-eslint": "^6.0.0",
|
||||
"gulp-pug": "^5.0.0",
|
||||
"joi": "^17.9.2",
|
||||
"jquery": "^3.7.0",
|
||||
"jquery": "^3.7.1",
|
||||
"json3": "^3.3.3",
|
||||
"mocha": "^10.2.0",
|
||||
"mocha-headless-chrome": "^4.0.0",
|
||||
"nyc": "^15.1.0",
|
||||
"nyc": "^17.1.0",
|
||||
"proxyquire": "^2.1.3",
|
||||
"serve-static": "^1.15.0",
|
||||
"sinon": "^15.2.0",
|
||||
"ua-parser-js": "^1.0.35"
|
||||
"ua-parser-js": "^1.0.39"
|
||||
},
|
||||
"scripts": {
|
||||
"--- DEFAULT SCRIPTS ---": "",
|
||||
"start": "gulp default",
|
||||
"test": "nyc gulp test",
|
||||
"test": "gulp test",
|
||||
"--- GULP SCRIPTS ---": "",
|
||||
"clean": "gulp clean",
|
||||
"lint": "gulp eslint",
|
||||
"coverage": "nyc gulp test",
|
||||
"coverage:lcov": "nyc --reporter=lcov gulp test",
|
||||
"--- MODERNIZR SCRIPTS ---": "",
|
||||
"serve-gh-pages": "gulp serve:gh-pages",
|
||||
"update-gh-pages": "scripts/generate-gh-pages.sh",
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
define(function() {
|
||||
/**
|
||||
* is returns a boolean if the typeof an obj is exactly type.
|
||||
*
|
||||
* @access private
|
||||
* @function is
|
||||
* @function
|
||||
* @param {*} obj - A thing we want to check the type of
|
||||
* @param {string} type - A string to compare the typeof against
|
||||
* @returns {boolean} true if the typeof the first parameter is exactly the specified type, false otherwise
|
||||
|
||||
Reference in New Issue
Block a user