diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 9d336bc..af7b292 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -29,3 +29,27 @@ jobs: - run: npm ci - run: npm test - run: npm run eslint + + # Checks code formatting, fails if there are changes after applying prettier. + # Based on this example here: + # https://github.com/creyD/prettier_action?tab=readme-ov-file#example-4-dry-run + prettier: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + # Make sure the actual branch is checked out when running on pull requests + ref: ${{ github.head_ref }} + # Make sure the value of GITHUB_TOKEN will not be persisted in repo's config + persist-credentials: false + + - name: Prettify code + uses: creyD/prettier_action@v4.3 + with: + # "dry" causes that if any file is modified, the job fails + dry: True + # "write" performs changes in place + prettier_options: --write lib/*.ts test/*.js examples/**/*.js + github_token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} diff --git a/examples/express-sample/app.js b/examples/express-sample/app.js index 1a999f7..3ef9d4a 100644 --- a/examples/express-sample/app.js +++ b/examples/express-sample/app.js @@ -1,56 +1,60 @@ -var config = require('config'); +var config = require("config"); -if (config.Raygun.Key === 'YOUR_API_KEY') { - console.error('You need to set your Raygun API key in the config file'); - process.exit(1); +if (config.Raygun.Key === "YOUR_API_KEY") { + console.error("You need to set your Raygun API key in the config file"); + process.exit(1); } // Setup Raygun -var raygun = require('raygun'); +var raygun = require("raygun"); var raygunClient = new raygun.Client().init({ - apiKey: config.Raygun.Key + apiKey: config.Raygun.Key, }); -var express = require('express'); -var path = require('path'); -var logger = require('morgan'); -var cookieParser = require('cookie-parser'); -var bodyParser = require('body-parser'); -var sassMiddleware = require('node-sass-middleware'); +var express = require("express"); +var path = require("path"); +var logger = require("morgan"); +var cookieParser = require("cookie-parser"); +var bodyParser = require("body-parser"); +var sassMiddleware = require("node-sass-middleware"); -var routes = require('./routes/index'); -var users = require('./routes/users'); +var routes = require("./routes/index"); +var users = require("./routes/users"); var app = express(); // Set the user if we have one -raygunClient.user = function(req) { - return 'user@example.com'; +raygunClient.user = function (req) { + return "user@example.com"; }; // view engine setup -app.set('views', path.join(__dirname, 'views')); -app.set('view engine', 'ejs'); +app.set("views", path.join(__dirname, "views")); +app.set("view engine", "ejs"); // uncomment after placing your favicon in /public //app.use(favicon(__dirname + '/public/favicon.ico')); -app.use(logger('dev')); +app.use(logger("dev")); app.use(bodyParser.json()); -app.use(bodyParser.urlencoded({ - extended: false -})); +app.use( + bodyParser.urlencoded({ + extended: false, + }), +); app.use(cookieParser()); -app.use(sassMiddleware({ - src: __dirname, - dest: path.join(__dirname, 'public'), - debug: true, - outputStyle: 'compressed', - prefix: '/stylesheets' -})); -app.use(express.static(path.join(__dirname, 'public'))); - -app.use('/', routes); -app.use('/users', users); +app.use( + sassMiddleware({ + src: __dirname, + dest: path.join(__dirname, "public"), + debug: true, + outputStyle: "compressed", + prefix: "/stylesheets", + }), +); +app.use(express.static(path.join(__dirname, "public"))); + +app.use("/", routes); +app.use("/users", users); // Add the Raygun Express handler app.use(raygunClient.expressHandler); diff --git a/examples/express-sample/routes/index.js b/examples/express-sample/routes/index.js index 0907a9c..523d931 100644 --- a/examples/express-sample/routes/index.js +++ b/examples/express-sample/routes/index.js @@ -1,17 +1,17 @@ -var express = require('express'); +var express = require("express"); var router = express.Router(); /* GET home page. */ -router.get('/', function(req, res, next) { - res.render('index', { - title: 'Express' - }); +router.get("/", function (req, res, next) { + res.render("index", { + title: "Express", + }); }); -router.get('/error', function(req, res, next) { - // Call an object that doesn't exist to send an error to Raygun - fakeObject.FakeMethod(); - res.send(500); +router.get("/error", function (req, res, next) { + // Call an object that doesn't exist to send an error to Raygun + fakeObject.FakeMethod(); + res.send(500); }); -module.exports = router; \ No newline at end of file +module.exports = router; diff --git a/examples/express-sample/routes/users.js b/examples/express-sample/routes/users.js index 623e430..7981267 100644 --- a/examples/express-sample/routes/users.js +++ b/examples/express-sample/routes/users.js @@ -1,9 +1,9 @@ -var express = require('express'); +var express = require("express"); var router = express.Router(); /* GET users listing. */ -router.get('/', function(req, res, next) { - res.send('respond with a resource'); +router.get("/", function (req, res, next) { + res.send("respond with a resource"); }); module.exports = router; diff --git a/examples/using-domains/app.js b/examples/using-domains/app.js index 9b0d29e..98a66e6 100644 --- a/examples/using-domains/app.js +++ b/examples/using-domains/app.js @@ -1,52 +1,52 @@ -var config = require('config'); +var config = require("config"); -if (config.Raygun.Key === 'YOUR_API_KEY') { - console.error('You need to set your Raygun API key in the config file'); - process.exit(1); +if (config.Raygun.Key === "YOUR_API_KEY") { + console.error("You need to set your Raygun API key in the config file"); + process.exit(1); } // Setup Raygun -var raygun = require('raygun'); -var raygunClient = new raygun.Client().init({apiKey: config.Raygun.Key}); +var raygun = require("raygun"); +var raygunClient = new raygun.Client().init({ apiKey: config.Raygun.Key }); // Create a domain -var appDomain = require('domain').create(); +var appDomain = require("domain").create(); // Add the error handler so we can pass errors to Raygun when the domain // crashes -appDomain.on('error', function (err) { - try { - console.log(`Domain error caught: ${err}`); - // Try send data to Raygun - raygunClient.send(err, {}, function () { - // Exit the process once the error has been sent - console.log('Error sent to Raygun, exiting process'); - process.exit(1); - }); - } catch (e) { - // If there was an error sending to Raygun, log it out and end the process. - // Could possibly log out to a text file here - console.log(e); - process.exit(1); - } +appDomain.on("error", function (err) { + try { + console.log(`Domain error caught: ${err}`); + // Try send data to Raygun + raygunClient.send(err, {}, function () { + // Exit the process once the error has been sent + console.log("Error sent to Raygun, exiting process"); + process.exit(1); + }); + } catch (e) { + // If there was an error sending to Raygun, log it out and end the process. + // Could possibly log out to a text file here + console.log(e); + process.exit(1); + } }); // Run the domain appDomain.run(function () { - var fs = require('fs'); + var fs = require("fs"); - console.log('Running example app'); + console.log("Running example app"); - // Try and read a file that doesn't exist - fs.readFile('badfile.json', 'utf8', function (err, file) { - if (err) { - // We could send the error straight to Raygun - // raygunClient.send(err); + // Try and read a file that doesn't exist + fs.readFile("badfile.json", "utf8", function (err, file) { + if (err) { + // We could send the error straight to Raygun + // raygunClient.send(err); - // Or we can deal with it in our "Fake Error Handler" below + // Or we can deal with it in our "Fake Error Handler" below - // This will throw an error as fakeErrorHandler doesn't exist - fakeErrorHandler.DealWith(err); - } - }) -}); \ No newline at end of file + // This will throw an error as fakeErrorHandler doesn't exist + fakeErrorHandler.DealWith(err); + } + }); +}); diff --git a/lib/raygun.batch.ts b/lib/raygun.batch.ts index 00b43fe..c71ef77 100644 --- a/lib/raygun.batch.ts +++ b/lib/raygun.batch.ts @@ -64,7 +64,7 @@ export class RaygunBatchTransport { } private onIncomingMessage(messageAndCallback: MessageAndCallback) { - const { serializedMessage} = messageAndCallback; + const { serializedMessage } = messageAndCallback; const messageLength = Buffer.byteLength(serializedMessage, "utf-8"); if (messageLength >= MAX_BATCH_INNER_SIZE_BYTES) { @@ -72,7 +72,7 @@ export class RaygunBatchTransport { const startOfMessage = serializedMessage.slice(0, 1000); console.warn( - `[raygun4node] Error is too large to send to Raygun (${messageSize}kb)\nStart of error: ${startOfMessage}` + `[raygun4node] Error is too large to send to Raygun (${messageSize}kb)\nStart of error: ${startOfMessage}`, ); return; @@ -123,7 +123,7 @@ export class RaygunBatchTransport { const { payload, messageCount, callbacks } = batch; debug( - `batch transport - processing ( ${messageCount} message(s) in batch)` + `batch transport - processing ( ${messageCount} message(s) in batch)`, ); const batchId = this.batchId; @@ -132,16 +132,16 @@ export class RaygunBatchTransport { const runAllCallbacks = ( err: Error | null, - response: IncomingMessage | null + response: IncomingMessage | null, ) => { const durationInMs = stopTimer(); if (err) { debug( - `batch transport - error sending batch (id=${batchId}, duration=${durationInMs}ms): ${err}` + `batch transport - error sending batch (id=${batchId}, duration=${durationInMs}ms): ${err}`, ); } else { debug( - `batch transport - successfully sent batch (id=${batchId}, duration=${durationInMs}ms)` + `batch transport - successfully sent batch (id=${batchId}, duration=${durationInMs}ms)`, ); } @@ -153,7 +153,7 @@ export class RaygunBatchTransport { }; debug( - `batch transport - sending batch (id=${batchId}) (${messageCount} messages, ${payload.length} bytes)` + `batch transport - sending batch (id=${batchId}) (${messageCount} messages, ${payload.length} bytes)`, ); const stopTimer = startTimer(); diff --git a/lib/raygun.messageBuilder.ts b/lib/raygun.messageBuilder.ts index cc43a95..b79c5e1 100644 --- a/lib/raygun.messageBuilder.ts +++ b/lib/raygun.messageBuilder.ts @@ -50,7 +50,7 @@ function filterKeys(obj: object, filters: string[]): object { function getStackTrace( error: Error, - options: MessageBuilderOptions + options: MessageBuilderOptions, ): StackFrame[] { const stack: StackFrame[] = []; const trace = stackTrace.parse(error); @@ -78,7 +78,7 @@ function getStackTrace( function buildError( error: IndexableError, - options: MessageBuilderOptions + options: MessageBuilderOptions, ): BuiltError { const builtError: BuiltError = { stackTrace: getStackTrace(error, options), diff --git a/lib/raygun.offline.ts b/lib/raygun.offline.ts index a837dde..2782a8e 100644 --- a/lib/raygun.offline.ts +++ b/lib/raygun.offline.ts @@ -28,13 +28,14 @@ export class OfflineStorage implements IOfflineStorage { } private _sendAndDelete(item: string) { - fs.readFile(path.join(this.cachePath, item), "utf8", ( - err, - cacheContents - ) => { - this.transport.send(cacheContents); - fs.unlink(path.join(this.cachePath, item), () => {}); - }); + fs.readFile( + path.join(this.cachePath, item), + "utf8", + (err, cacheContents) => { + this.transport.send(cacheContents); + fs.unlink(path.join(this.cachePath, item), () => {}); + }, + ); } init(offlineStorageOptions: OfflineStorageOptions | undefined) { @@ -46,7 +47,7 @@ export class OfflineStorage implements IOfflineStorage { this.cacheLimit = offlineStorageOptions.cacheLimit || 100; debug( - `offline storage - initialized (cachePath=${this.cachePath}, cacheLimit=${this.cacheLimit}` + `offline storage - initialized (cachePath=${this.cachePath}, cacheLimit=${this.cacheLimit}`, ); if (!fs.existsSync(this.cachePath)) { @@ -86,7 +87,7 @@ export class OfflineStorage implements IOfflineStorage { } retrieve( - callback: (error: NodeJS.ErrnoException | null, items: string[]) => void + callback: (error: NodeJS.ErrnoException | null, items: string[]) => void, ) { fs.readdir(this.cachePath, callback); } @@ -101,7 +102,7 @@ export class OfflineStorage implements IOfflineStorage { if (items.length > 0) { debug( - "offline storage - transporting ${items.length} message(s) from cache" + "offline storage - transporting ${items.length} message(s) from cache", ); } diff --git a/lib/raygun.sync.transport.ts b/lib/raygun.sync.transport.ts index 55f1aea..15aac77 100644 --- a/lib/raygun.sync.transport.ts +++ b/lib/raygun.sync.transport.ts @@ -26,7 +26,7 @@ export function send(options: SendOptionsWithoutCB) { syncRequest(options); } catch (e) { console.log( - `Raygun: error ${e} occurred while attempting to send error with message: ${options.message}` + `Raygun: error ${e} occurred while attempting to send error with message: ${options.message}`, ); } } diff --git a/lib/raygun.sync.worker.ts b/lib/raygun.sync.worker.ts index 9f915df..c04715d 100644 --- a/lib/raygun.sync.worker.ts +++ b/lib/raygun.sync.worker.ts @@ -16,7 +16,7 @@ function callback(error: Error | null, result: IncomingMessage | null) { console.log("Error sending with sync transport", error); } else { console.log( - "[raygun-apm] Successfully reported uncaught exception to Raygun" + "[raygun-apm] Successfully reported uncaught exception to Raygun", ); } } diff --git a/lib/raygun.transport.ts b/lib/raygun.transport.ts index 3e2cbac..aa78f49 100644 --- a/lib/raygun.transport.ts +++ b/lib/raygun.transport.ts @@ -54,7 +54,7 @@ export function send(options: SendOptions, path = DEFAULT_ENDPOINT) { request.on("error", function (e) { console.log( - `Raygun: error ${e.message} occurred while attempting to send error with message: ${options.message}` + `Raygun: error ${e.message} occurred while attempting to send error with message: ${options.message}`, ); // If the callback has two parameters, it should expect an `error` value. @@ -67,7 +67,7 @@ export function send(options: SendOptions, path = DEFAULT_ENDPOINT) { request.end(); } catch (e) { console.log( - `Raygun: error ${e} occurred while attempting to send error with message: ${options.message}` + `Raygun: error ${e} occurred while attempting to send error with message: ${options.message}`, ); } } diff --git a/lib/raygun.ts b/lib/raygun.ts index 6ae21f8..d7552a0 100644 --- a/lib/raygun.ts +++ b/lib/raygun.ts @@ -190,21 +190,21 @@ class Raygun { customData?: CustomData, callback?: (err: Error | null) => void, request?: RequestParams, - tags?: Tag[] + tags?: Tag[], ): Message { const sendOptionsResult = this.buildSendOptions( exception, customData, callback, request, - tags + tags, ); const message = sendOptionsResult.message; if (!sendOptionsResult.valid) { console.error( - `Encountered an error sending an error to Raygun. No API key is configured, please ensure .init is called with api key. See docs for more info.` + `Encountered an error sending an error to Raygun. No API key is configured, please ensure .init is called with api key. See docs for more info.`, ); return sendOptionsResult.message; } @@ -214,7 +214,7 @@ class Raygun { if (this._isOffline) { this.offlineStorage().save( JSON.stringify(message), - callback || emptyCallback + callback || emptyCallback, ); } else { this.transport().send(sendOptions); @@ -234,7 +234,7 @@ class Raygun { (major === 13 && minor < 7) ) { console.log( - "[Raygun] Warning: reportUncaughtExceptions requires at least Node v12.17.0 or v13.7.0. Uncaught exceptions will not be automatically reported." + "[Raygun] Warning: reportUncaughtExceptions requires at least Node v12.17.0 or v13.7.0. Uncaught exceptions will not be automatically reported.", ); return; @@ -250,14 +250,14 @@ class Raygun { customData?: CustomData, callback?: (err: Error | null) => void, request?: RequestParams, - tags?: Tag[] + tags?: Tag[], ): void { const result = this.buildSendOptions( exception, customData, callback, request, - tags + tags, ); if (result.valid) { @@ -279,7 +279,7 @@ class Raygun { hostname: req.hostname, path: req.path, method: req.method, - ip: req.ip ?? '', + ip: req.ip ?? "", query: req.query, headers: req.headers, body: req.body, @@ -303,7 +303,7 @@ class Raygun { customData?: CustomData, callback?: Callback, request?: RequestParams, - tags?: Tag[] + tags?: Tag[], ): SendOptionsResult { let mergedTags: Tag[] = []; @@ -361,7 +361,7 @@ class Raygun { function wrappedCallback( error: Error | null, - response: IncomingMessage | null + response: IncomingMessage | null, ) { const durationInMs = stopTimer(); if (error) { @@ -400,7 +400,7 @@ class Raygun { port: this._port, useSSL: this._useSSL || false, apiKey: this._apiKey || "", - } + }; return { send(message: string) { @@ -421,7 +421,7 @@ class Raygun { } storage = this._offlineStorage = new OfflineStorage( - this.offlineTransport() + this.offlineTransport(), ); return storage; diff --git a/lib/timer.ts b/lib/timer.ts index f3b09db..31bf731 100644 --- a/lib/timer.ts +++ b/lib/timer.ts @@ -4,6 +4,5 @@ export function startTimer(): () => number { return function stopTimer() { const [seconds, nanoseconds] = process.hrtime(startTime); return Math.round(seconds * 1000 + nanoseconds / 1e6); // in milliseconds - } + }; } - diff --git a/lib/types.ts b/lib/types.ts index 9e18ffa..a869c6c 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -143,14 +143,14 @@ export type Hook = ( exception: Error | string, customData: CustomData, request?: RequestParams, - tags?: Tag[] + tags?: Tag[], ) => T; export interface IOfflineStorage { init(options: OfflineStorageOptions | undefined): void; save(message: string, callback: (error: Error | null) => void): void; retrieve( - callback: (error: NodeJS.ErrnoException | null, items: string[]) => void + callback: (error: NodeJS.ErrnoException | null, items: string[]) => void, ): void; send(callback: (error: Error | null, items?: string[]) => void): void; } @@ -179,7 +179,7 @@ export type CallbackNoError = (t: T | null) => void; export type CallbackWithError = (e: Error | null, t: T | null) => void; export function isCallbackWithError( - cb: Callback + cb: Callback, ): cb is CallbackWithError { return cb.length > 1; } @@ -187,7 +187,7 @@ export function isCallbackWithError( export function callVariadicCallback( callback: Callback, error: Error | null, - result: T | null + result: T | null, ) { if (isCallbackWithError(callback)) { return callback(error, result); diff --git a/package.json b/package.json index eae608a..9463271 100644 --- a/package.json +++ b/package.json @@ -31,9 +31,16 @@ "CHANGELOG.md" ], "scripts": { + "//eslint": "performs static analysis over project files and examples", "eslint": "eslint --fix lib/*.ts test/*.js examples/**/*.js", - "prettier": "prettier --write lib/*.ts test/*.js", + + "//prettier": "performs code formatting over project files and examples", + "prettier": "prettier --write lib/*.ts test/*.js examples/**/*.js", + + "//prepare": "prepare project for distribution", "prepare": "tsc", + + "//test": "runs tests on main project", "test": "tap --node-arg=-r --node-arg=ts-node/register --disable-coverage test/*_test.js" }, "devDependencies": { diff --git a/test/raygun.messageBuilder_test.js b/test/raygun.messageBuilder_test.js index e3f3b09..c8cf3e6 100644 --- a/test/raygun.messageBuilder_test.js +++ b/test/raygun.messageBuilder_test.js @@ -2,8 +2,8 @@ const deepEqual = require("assert").deepEqual; var test = require("tap").test; -var MessageBuilder = require("../lib/raygun.messageBuilder.ts") - .RaygunMessageBuilder; +var MessageBuilder = + require("../lib/raygun.messageBuilder.ts").RaygunMessageBuilder; var VError = require("verror"); test("basic builder tests", function (t) { @@ -192,7 +192,7 @@ test("inner error builder tests", function (t) { tt.equal(message.details.error.innerError.message, innerErrorMessage); tt.equal( message.details.error.innerError.innerError.message, - innerInnerErrorMessage + innerInnerErrorMessage, ); tt.end(); @@ -206,7 +206,7 @@ test("VError support", function (t) { var error = new VError( new VError(new VError(innerInnerErrorMessage), innerErrorMessage), - "Outer Error" + "Outer Error", ); var builder = new MessageBuilder({ innerErrorFieldName: "cause" }); @@ -334,17 +334,17 @@ test("user and version builder tests", function (t) { tt.equal( message.details.user.identifier, "testuser", - "identifier should be set to the one in the object we returned from the user function" + "identifier should be set to the one in the object we returned from the user function", ); tt.equal( message.details.user.email, "test@example.com", - "email should be set to the one in the object we returned from the user function" + "email should be set to the one in the object we returned from the user function", ); tt.equal( message.details.user.notSupportedProp, undefined, - "should skip unknown properties" + "should skip unknown properties", ); tt.end(); }); diff --git a/test/raygun_batch_lifecycle_test.js b/test/raygun_batch_lifecycle_test.js index 936c5e4..7a0530c 100644 --- a/test/raygun_batch_lifecycle_test.js +++ b/test/raygun_batch_lifecycle_test.js @@ -14,7 +14,7 @@ test("batch transport doesn't keep processes alive", async (t) => { t.equal(process.exitCode, 0); resolve(); - } + }, ); }); }); diff --git a/test/raygun_express_test.js b/test/raygun_express_test.js index f140562..e53f700 100644 --- a/test/raygun_express_test.js +++ b/test/raygun_express_test.js @@ -26,20 +26,16 @@ test("reporting express errors", async function (t) { t.ok( message.details.tags.includes("UnhandledException"), - `Expected message to include tag "UnhandledException" but instead found: ${message.details.tags}` + `Expected message to include tag "UnhandledException" but instead found: ${message.details.tags}`, ); }); test("batch reporting errors", async function (t) { - const { - client, - server, - stop, - nextBatchRequest, - } = await makeClientWithMockServer({ - batch: true, - batchFrequency: 1000, - }); + const { client, server, stop, nextBatchRequest } = + await makeClientWithMockServer({ + batch: true, + batchFrequency: 1000, + }); client.send(new Error("a")); client.send(new Error("b")); @@ -57,20 +53,16 @@ test("batch reporting errors", async function (t) { t.equal(server.bulkEntries.length, 1); t.same( server.bulkEntries[0].map((e) => e.details.error.message), - ["a", "b", "c"] + ["a", "b", "c"], ); }); test("batch transport discards massive errors", async function (t) { - const { - client, - server, - stop, - nextBatchRequest, - } = await makeClientWithMockServer({ - batch: true, - batchFrequency: 1000, - }); + const { client, server, stop, nextBatchRequest } = + await makeClientWithMockServer({ + batch: true, + batchFrequency: 1000, + }); client.send(new Error("a".repeat(MAX_BATCH_SIZE_BYTES))); client.send(new Error("b")); @@ -87,7 +79,7 @@ test("batch transport discards massive errors", async function (t) { t.equal(server.bulkEntries.length, 1); t.same( server.bulkEntries[0].map((e) => e.details.error.message), - ["b"] + ["b"], ); }); diff --git a/test/raygun_offline_test.js b/test/raygun_offline_test.js index a02e962..aff1cd0 100644 --- a/test/raygun_offline_test.js +++ b/test/raygun_offline_test.js @@ -35,7 +35,7 @@ test("offline message storage and sending", async function (t) { t.equal( files.length, 1, - `Expected to find 1 error file but instead found ${files.length}` + `Expected to find 1 error file but instead found ${files.length}`, ); const file = files[0]; @@ -55,7 +55,7 @@ test("offline message storage and sending", async function (t) { t.equal( filesAfterSend.length, 0, - `Expected to find no stored error files but instead found ${filesAfterSend.length}` + `Expected to find no stored error files but instead found ${filesAfterSend.length}`, ); testEnvironment.stop(); @@ -91,7 +91,7 @@ test("batched offline message storage and sending", async function (t) { t.equal( files.length, 1, - `Expected to find 1 error file but instead found ${files.length}` + `Expected to find 1 error file but instead found ${files.length}`, ); const file = files[0]; @@ -110,7 +110,7 @@ test("batched offline message storage and sending", async function (t) { t.equal( filesAfterSend.length, 0, - `Expected to find no stored error files but instead found ${filesAfterSend.length}` + `Expected to find no stored error files but instead found ${filesAfterSend.length}`, ); t.same(batch.map((e) => e.details.error.message).sort(), [ diff --git a/test/raygun_send_test.js b/test/raygun_send_test.js index 71db4a6..7ab340b 100644 --- a/test/raygun_send_test.js +++ b/test/raygun_send_test.js @@ -89,7 +89,7 @@ test("send with verror", {}, function (t) { var error = new VError( new VError(new VError("Deep Error"), "Inner Error"), - "Outer Error" + "Outer Error", ); var client = new Raygun.Client().init({ @@ -176,6 +176,6 @@ test("check that tags get merged", {}, function (t) { t.end(); }, null, - ["Tag2"] + ["Tag2"], ); }); diff --git a/test/raygun_uncaught_exception_test.js b/test/raygun_uncaught_exception_test.js index 4202763..aa94686 100644 --- a/test/raygun_uncaught_exception_test.js +++ b/test/raygun_uncaught_exception_test.js @@ -20,7 +20,7 @@ test("reporting uncaught exceptions", async function (t) { RAYGUN_API_KEY: "test", RAYGUN_API_PORT: testEnvironment.address.port, }, - } + }, ) .catch(() => {}); diff --git a/test/utils.js b/test/utils.js index c3192cb..4e4dc19 100644 --- a/test/utils.js +++ b/test/utils.js @@ -63,9 +63,9 @@ function makeClientWithMockServer(clientOptions = {}) { setTimeout( () => reject( - new Error(`nextRequest timed out after ${options.maxWait}ms`) + new Error(`nextRequest timed out after ${options.maxWait}ms`), ), - options.maxWait + options.maxWait, ); }), nextBatchRequest: (options = { maxWait: 10000 }) => @@ -75,10 +75,10 @@ function makeClientWithMockServer(clientOptions = {}) { () => reject( new Error( - `nextBatchRequest timed out after ${options.maxWait}ms` - ) + `nextBatchRequest timed out after ${options.maxWait}ms`, + ), ), - options.maxWait + options.maxWait, ); }), });