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

build: add Node 16 and 18 to the CI matrix #6

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Expand Up @@ -20,7 +20,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
cache: npm
- run: npm ci
- run: npm run build:check
Expand All @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12]
node: [10, 12, 14, 18]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
Expand All @@ -48,7 +48,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
node: [10, 12, 14]
node: [10, 12, 14, 16, 18]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
Expand Down
2 changes: 1 addition & 1 deletion docs/intro/01-installation.md
Expand Up @@ -5,7 +5,7 @@ Karma runs on [Node.js] and is available as an [npm] package.
On Mac or Linux we recommend using [NVM](https://github.com/creationix/nvm). On Windows, download Node.js
from [the official site](https://nodejs.org/) or use the [NVM PowerShell Module](https://www.powershellgallery.com/packages/nvm).

Note: Karma currently works on Node.js **6.x**, **8.x**, and **10.x**. See [FAQ] for more info.
Karma works on all [LTS releases](https://nodejs.org/en/about/releases/) of Node.js.

## Installing Karma and plugins

Expand Down
2 changes: 1 addition & 1 deletion docs/intro/04-faq.md
Expand Up @@ -27,7 +27,7 @@ The latest stable version from npm (`npm install karma`). See [versioning] for m


### Which version of Node.js does Karma run with?
Karma works on all active LTS versions of node as specified by the [Node.js Release Working Group](https://github.com/nodejs/Release/blob/master/README.md). The nodejs version numbers are set in the package.json. Older versions of karma work with older versions of nodejs, but are not maintained or updated.
Karma works on all LTS versions of Node.js as specified by the [Node.js Release Working Group](https://github.com/nodejs/Release/blob/master/README.md). The Node.js version numbers are set in the package.json. Older versions of karma work with older versions of Node.js, but are not maintained or updated.

[mailing list]: https://groups.google.com/d/forum/karma-users
[karma-ng-scenario]: https://github.com/karma-runner/karma-ng-scenario
Expand Down
6 changes: 5 additions & 1 deletion lib/middleware/proxy.js
@@ -1,3 +1,4 @@
const dns = require('dns')
const url = require('url')
const { Agent: httpAgent } = require('http')
const { Agent: httpsAgent } = require('https')
Expand Down Expand Up @@ -41,7 +42,10 @@ function parseProxyConfig (proxies, config) {
const port = proxyDetails.port || defaultPorts[proxyDetails.protocol] || config.port
const changeOrigin = proxyConfiguration.changeOrigin || false
const Agent = protocol === 'https:' ? httpsAgent : httpAgent
const agent = new Agent({ keepAlive: true })
const agent = new Agent({
keepAlive: true,
lookup: (hostname, options, callback) => dns.lookup(hostname, { ...options, verbatim: false }, callback)
})
const proxy = httpProxy.createProxyServer({
target: { host: hostname, port, protocol },
xfwd: true,
Expand Down
4 changes: 3 additions & 1 deletion lib/runner.js
@@ -1,5 +1,6 @@
'use strict'

const dns = require('dns')
const http = require('http')

const constant = require('./constants')
Expand Down Expand Up @@ -74,7 +75,8 @@ function run (cliOptionsOrConfig, done) {
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
},
lookup: (hostname, options, callback) => dns.lookup(hostname, { ...options, verbatim: false }, callback)
}

const request = http.request(options, function (response) {
Expand Down
4 changes: 3 additions & 1 deletion lib/stopper.js
@@ -1,3 +1,4 @@
const dns = require('dns')
const http = require('http')
const cfg = require('./config')
const logger = require('./logger')
Expand Down Expand Up @@ -42,7 +43,8 @@ exports.stop = function (cliOptionsOrConfig, done) {
hostname: config.hostname,
path: config.urlRoot + 'stop',
port: config.port,
method: 'GET'
method: 'GET',
lookup: (hostname, options, callback) => dns.lookup(hostname, { ...options, verbatim: false }, callback)
})

request.on('response', function (response) {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/support/proxy.js
Expand Up @@ -8,7 +8,7 @@ module.exports = class Proxy {
this.proxyPathRegExp = null

this.proxy = httpProxy.createProxyServer({
target: 'http://localhost:9876'
target: 'http://127.0.0.1:9876'
})

this.proxy.on('error', (err) => {
Expand Down