diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64331528..26bcb100 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,81 +67,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - node-version: - - "4" - - "5" - - "6" - - "7" - - "8" - - "9" - - "10" - - "11" - - "12" - - "13" - - "14" - - "15" - - "16" - - "17" - - "18" - - "19" - - "20" - - "21" - - "22" - - "23" - - "24" - # Use supported versions of our testing tools under older versions of Node - # Install npm in some specific cases where we need to - include: - - node-version: "4.5" - npm-i: "mocha@5.2.0 nyc@11.9.0" - npm-rm: 'iconv' - - - node-version: "5.10" - npm-i: "mocha@5.2.0 nyc@11.9.0" - # fixes https://github.com/npm/cli/issues/681 - npm-version: npm@2.15.11 - npm-rm: 'iconv' - - - node-version: "6" - npm-i: "mocha@6.2.2 nyc@14.1.1" - npm-version: npm@6.13.4 - npm-rm: 'iconv' - - - node-version: "7" - npm-i: "mocha@6.2.2 nyc@14.1.1" - npm-version: npm@6.13.4 - npm-rm: 'iconv' - - - node-version: "8" - npm-i: "mocha@7.2.0 nyc@14.1.1" - npm-version: npm@6.13.4 - npm-rm: 'iconv' - - - node-version: "9" - npm-i: "mocha@7.2.0 nyc@14.1.1" - npm-rm: 'iconv' - - - node-version: "10" - npm-i: "mocha@8.4.0" - npm-rm: 'iconv' - - - node-version: "11" - npm-i: "mocha@8.4.0" - npm-rm: 'iconv' - - - node-version: "12" - npm-i: "mocha@9.2.2" - npm-rm: 'iconv' - - - node-version: "13" - npm-i: "mocha@9.2.2" - npm-rm: 'iconv' - - - node-version: "14" - npm-rm: 'iconv' - - - node-version: "15" - npm-rm: 'iconv' + node-version: ["18.0.0", "18", "19", "20", "21", "22", "23", "24"] runs-on: ${{ matrix.os }} steps: @@ -163,14 +89,6 @@ jobs: npm config set loglevel error shell: bash - - name: Remove npm module(s) ${{ matrix.npm-rm }} - run: npm rm --silent --save-dev ${{ matrix.npm-rm }} neostandard @stylistic/eslint-plugin-js @stylistic/eslint-plugin eslint - if: matrix.npm-rm != '' - - - name: Install Node version specific dev deps - if: ${{ matrix.npm-i != '' }} - run: npm install --save-dev ${{ matrix.npm-i }} - - name: Install dependencies run: npm install @@ -227,7 +145,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: ["12", "*"] + node-version: ["18", "*"] runs-on: ubuntu-latest steps: @@ -240,8 +158,8 @@ jobs: with: node-version: ${{ matrix.node-version }} - - name: Remove npm module(s) iconv, eslint, neostandard, @stylistic/eslint-plugin-js, @stylistic/eslint-plugin - run: npm rm --silent --save-dev iconv neostandard @stylistic/eslint-plugin-js @stylistic/eslint-plugin eslint + - name: Install dependencies + run: npm install - name: Webpack test shell: bash diff --git a/package.json b/package.json index 362b9f15..c1d861d7 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "url": "https://github.com/pillarjs/iconv-lite.git" }, "engines": { - "node": ">=4.5.0 <5.0.0 || >=5.10.0" + "node": ">=18" }, "scripts": { "lint": "eslint", @@ -31,7 +31,7 @@ "test": "mocha --reporter spec --check-leaks --grep .", "test:ci": "nyc --exclude test --reporter=lcovonly --reporter=text npm test", "test:cov": "nyc --exclude test --reporter=html --reporter=text npm test", - "test:node-web": "ICONV_BACKEND=web mocha --grep '#node-web'", + "test:node-web": "mocha --grep '#node-web'", "test:performance": "node --allow-natives-syntax performance/index.js", "test:tap": "mocha --reporter tap --check-leaks --grep .", "test:webpack": "npm pack && mv iconv-lite-*.tgz test/webpack/iconv-lite.tgz && cd test/webpack && npm install && npm run test && rm iconv-lite.tgz" diff --git a/test/webpack/karma.conf.js b/test/webpack/karma.conf.js index 42606a99..eefa91fc 100644 --- a/test/webpack/karma.conf.js +++ b/test/webpack/karma.conf.js @@ -59,7 +59,14 @@ module.exports = function (config) { // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: ["ChromeHeadless"], + browsers: ["ChromeHeadless", "ChromeHeadlessCI"], + + customLaunchers: { + ChromeHeadlessCI: { + base: "ChromeHeadless", + flags: ["--no-sandbox"] + } + }, // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits diff --git a/test/webpack/package.json b/test/webpack/package.json index d047253f..055e5fee 100644 --- a/test/webpack/package.json +++ b/test/webpack/package.json @@ -15,7 +15,8 @@ "karma-webpack": "^4.0.2", "mocha": "^7.2.0", "puppeteer": "^4.0.0", - "webpack": "^4.43.0" + "webpack": "^4.43.0", + "unorm": "^1.6.0" }, "dependencies": { "iconv-lite": "file:iconv-lite.tgz"