Skip to content

Commit c1ad1fe

Browse files
update with latest flags
1 parent 3e5e42a commit c1ad1fe

File tree

10 files changed

+3563
-2374
lines changed

10 files changed

+3563
-2374
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
- 12
1818
- 14
1919
- 16
20+
- 20
21+
- 22
22+
- lts
2023
steps:
2124
- uses: actions/setup-node@v1
2225
with:
@@ -31,5 +34,5 @@ jobs:
3134
${{ runner.os }}-node-v${{ matrix.node }}-
3235
- name: Install Dependencies
3336
run: npm install
34-
- name: Run All Node.js Tests
37+
- name: Run All Tests
3538
run: npm run test

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ coverage
1818

1919
# node-waf configuration
2020
.lock-wscript
21-
22-
# Compiled binary addons (http://nodejs.org/api/addons.html)
23-
build/Release
21+
build
2422

2523
# Dependency directory
2624
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git

Makefile

Lines changed: 0 additions & 18 deletions
This file was deleted.

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# testingbot-tunnel-launcher
22

33
[![npm](https://img.shields.io/npm/v/testingbot-tunnel-launcher.svg?maxAge=2592000)](https://www.npmjs.com/package/testingbot-tunnel-launcher)
4-
[![dependencies Status](https://david-dm.org/testingbot/testingbot-tunnel-launcher/status.svg)](https://david-dm.org/testingbot/testingbot-tunnel-launcher)
5-
[![devDependencies Status](https://david-dm.org/testingbot/testingbot-tunnel-launcher/dev-status.svg)](https://david-dm.org/testingbot/testingbot-tunnel-launcher?type=dev)
64
[![Build Status](https://travis-ci.org/testingbot/testingbot-tunnel-launcher.svg?branch=master)](https://travis-ci.org/testingbot/testingbot-tunnel-launcher)
75

86
A library to download and launch TestingBot Tunnel.
@@ -69,8 +67,8 @@ var testingbotTunnel = require('testingbot-tunnel-launcher'),
6967
// Write logging output to this logfile (optional)
7068
logfile: null,
7169

72-
// Change the tunnel version - see versions on https://testingbot.com/support/other/tunnel
73-
tunnelVersion: "1.19", // or 2.1 (Java 8)
70+
// Change the tunnel version - see versions on https://testingbot.com/support/other/tunnel/changelog.html
71+
tunnelVersion: "4.0",
7472

7573
// Gives this tunnel a unique identifier
7674
tunnelIdentifier: "myIdentifier"
@@ -100,6 +98,12 @@ npm test
10098

10199
## Changelog
102100

101+
### v1.1.13
102+
- Add support for `noBump`
103+
104+
### v1.1.12
105+
- Improve error handling
106+
103107
### v1.1.11
104108
- Add support for `tunnelIdentifier`
105109
- Improve parsing of arguments passed to the tunnel

lib/downloader.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@
33
const https = require('https')
44
const fs = require('fs')
55

6+
/**
7+
* Downloads a file from the given URL to the specified destination.
8+
* @param {string} url - The URL to download the file from.
9+
* @param {Object} options - The options object containing the destination.
10+
* @param {Function} cb - The callback function to handle success or error.
11+
*/
612
exports.get = function (url, options, cb) {
713
const dest = options.destination
814

915
https.get(url, response => {
10-
if (parseInt(response.statusCode.toString().substring(0, 1), 10) > 3) {
16+
if (response.statusCode >= 400) {
1117
return cb(new Error(`Could not download ${url}, statusCode: ${response.statusCode.toString()}`), null)
1218
}
1319

@@ -17,7 +23,11 @@ exports.get = function (url, options, cb) {
1723
file.close()
1824
cb(null, dest)
1925
})
20-
}).on('error', e => {
21-
cb(e.message, null)
26+
file.on('error', err => {
27+
fs.unlink(dest, () => {})
28+
cb(err, null)
29+
})
30+
}).on('error', err => {
31+
cb(err, null)
2232
})
2333
}

lib/tunnel-launcher.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ function createArgs (options) {
5959
args.push(tunnelLocation)
6060

6161
const optionMapping = {
62-
'tunnelIdentifier': 'tunnel-identifier'
62+
'tunnelIdentifier': 'tunnel-identifier',
63+
'noBump': 'nobump',
64+
'noCache': 'nocache'
6365
}
6466

6567
if (options.apiKey) {

0 commit comments

Comments
 (0)