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

Resolve jQuery isFunction warning #530

Merged
merged 5 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,27 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- uses: browser-actions/setup-chrome@latest

- name: Setup Chrome
id: setup-chrome
uses: browser-actions/setup-chrome@latest
with:
chrome-version: latest
install-chromedriver: true

- name: Set Chrome and ChromeDriver paths
run: |
echo "CHROME_BIN=${{ steps.setup-chrome.outputs.chrome-path }}" >> $GITHUB_ENV
echo "CHROMEDRIVER_PATH=${{ steps.setup-chrome.outputs.chromedriver-path }}" >> $GITHUB_ENV

- run: npm ci
- run: npx grunt
- run: npm test
env:
CHROME_BIN: ${{ env.CHROME_BIN }}
CHROMEDRIVER_PATH: ${{ env.CHROMEDRIVER_PATH }}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Unused normalize.css file

-->

## [3.1.1]

### Fixed
- Resolved jQuery `isFunction` deprecation warnings. As of jQuery 3.3, `jQuery.isFunction()` is deprecated. It is replaced by `typeof x === "function"` - [source](https://api.jquery.com/jQuery.isFunction/).

## [3.1.0]

### Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
],
"title": "Raygun4js",
"description": "Raygun.com plugin for JavaScript",
"version": "3.1.0",
"version": "3.1.1",
"homepage": "https://github.com/MindscapeHQ/raygun4js",
"author": {
"name": "MindscapeHQ",
Expand Down
2 changes: 1 addition & 1 deletion src/raygun.tracekit.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

var keys = ['complete', 'error', 'success'], key;
while(key = keys.pop()) {
if ($.isFunction(options[key])) {
if (typeof options[key] === "function") {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only change to the provider. The rest is related to Continuous Integration tests.

options[key] = TraceKit.wrap(options[key]);
}
}
Expand Down
41 changes: 36 additions & 5 deletions wdio.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
const fs = require('fs');
const path = require('path');

const chromeDriverExists = (path) => {
return fs.existsSync(path);
};

const githubActionsChromeDriver = process.env.CHROMEDRIVER_PATH;
const localChromeDriver = path.join(__dirname, 'node_modules', 'chromedriver', 'bin', 'chromedriver');

// If we are on a Continuous Integration server, use the ChromeDriver installed by browser-actions/setup-chrome.
// Otherwise, use the ChromeDriver installed as a devDependency.
let chromeDriverPath;
if (githubActionsChromeDriver && chromeDriverExists(githubActionsChromeDriver)) {
chromeDriverPath = githubActionsChromeDriver;
} else if (chromeDriverExists(localChromeDriver)) {
chromeDriverPath = localChromeDriver;
} else {
console.warn('ChromeDriver not found in expected locations. Using default.');
}

exports.config = {
//
// ====================
Expand Down Expand Up @@ -48,9 +69,16 @@ exports.config = {
capabilities: [{
maxInstances: 4,
browserName: 'chrome',
'goog:chromeOptions': {
args: ['headless', 'disable-gpu', 'no-sandbox']
},
'goog:chromeOptions': (function() {
const options = {
args: ['headless', 'disable-gpu', 'no-sandbox'],
};
// Use the CHROME_BIN environment variable if present.
if (process.env.CHROME_BIN) {
options.binary = process.env.CHROME_BIN;
}
return options;
})(),
}],
//
// ===================
Expand Down Expand Up @@ -112,8 +140,11 @@ exports.config = {
{ mount: '/fixtures', path: './tests/fixtures' },
{ mount: '/dist', path: './dist' },
]
}
], 'chromedriver'],
}],
['chromedriver', {
chromedriverCustomPath: chromeDriverPath
}]
],
chromeDriverArgs: ['--headless', '--disable-gpu'],

// Framework you want to run your specs with.
Expand Down
Loading