Skip to content

Commit

Permalink
adding sentry; ignoring config files from test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Gokul K authored and Gokul K committed Jun 10, 2024
1 parent 57a926e commit b66b16a
Show file tree
Hide file tree
Showing 6 changed files with 1,841 additions and 164 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
run: npm ci
- name: "Build"
run: npm run build
- name: "Test"
run: npm run coverage-summary
- name: "Run Tests & Coverage"
run: npm run test
- name: "Upload Coverage"
uses: actions/upload-artifact@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ node_modules
.parcel-cache/
coverage
.nyc_output

# Sentry Config File
.env.sentry-build-plugin
21 changes: 20 additions & 1 deletion js/editor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use strict";
import * as Sentry from "@sentry/browser";

import * as currency from "./currency.js";
import * as regex from "./regex.js";
Expand Down Expand Up @@ -499,7 +500,7 @@ function updateOutputDisplay() {
let len = results.length;
let localizedValue =
typeof value === "number"
? value.toLocaleString("en-US", { maximumFractionDigits: 15 })
? value.toLocaleString("en-US", { maximumFractionDigits: 5 })
: value;

switch (result.type) {
Expand Down Expand Up @@ -740,7 +741,25 @@ async function copyValueToClipboard(value) {
}
}

function initSentry() {
Sentry.init({
dsn: "https://f6181e1f6794abaf08674441d2c08403@o4507406315159552.ingest.de.sentry.io/4507406320992336",
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration(),
],
// Performance Monitoring
tracesSampleRate: 1.0, // Capture 100% of the transactions
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
tracePropagationTargets: ["localhost", /^https:\/\/typetocalculate\.in/],
// Session Replay
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
});
}

export async function init() {
initSentry();
setupDocument();
await loadSettings();
await loadData();
Expand Down
Loading

0 comments on commit b66b16a

Please sign in to comment.