Skip to content

Commit

Permalink
build: add is-jquery-obj function (#70)
Browse files Browse the repository at this point in the history
* add is-jquery-obj function

* update version
  • Loading branch information
PavelMor25 authored Apr 23, 2024
1 parent 4c01bbe commit f8d93a5
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 18 deletions.
15 changes: 2 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "testcafe-legacy-api",
"version": "5.1.7",
"version": "5.1.8",
"description": "Legacy API support for TestCafe",
"main": "lib/index.js",
"scripts": {
Expand Down Expand Up @@ -48,7 +48,6 @@
"async": "3.2.3",
"dedent": "^0.6.0",
"highlight-es": "^1.0.0",
"is-jquery-obj": "^0.1.0",
"lodash": "^4.14.0",
"moment": "^2.14.1",
"mustache": "^2.2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/client/api/actions/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as sourceIndexTracker from '../../source-index';
import forEachSeries from '../../deps/for-each-series';
import * as sandboxedJQuery from '../../sandboxed-jquery';
import ERROR_TYPE from '../../../test-run-error/type';
import isJQueryObj from 'is-jquery-obj';
import isJQueryObj from '../../../utils/is-jquery-obj';

var nativeMethods = hammerhead.nativeMethods;

Expand Down
2 changes: 1 addition & 1 deletion src/client/api/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as sourceIndexTracker from '../source-index';
import SETTINGS from '../settings';
import CROSS_DOMAIN_MESSAGES from '../cross-domain-messages';
import ERROR_TYPE from '../../test-run-error/type';
import isJQueryObj from 'is-jquery-obj';
import isJQueryObj from '../../utils/is-jquery-obj';

var messageSandbox = hammerhead.eventSandbox.message;

Expand Down
2 changes: 1 addition & 1 deletion src/client/runner-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import COMMAND from '../test-run/command';
import ERROR_TYPE from '../test-run-error/type';
import * as sandboxedJQuery from './sandboxed-jquery';
import * as transport from './transport';
import isJQueryObj from 'is-jquery-obj';
import isJQueryObj from '../utils/is-jquery-obj';

var messageSandbox = hammerhead.eventSandbox.message;
var nativeMethods = hammerhead.nativeMethods;
Expand Down
3 changes: 3 additions & 0 deletions src/utils/is-jquery-obj.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function (obj) {
return !!(obj && obj.jquery);
}
10 changes: 10 additions & 0 deletions test/server/is-jquery-obj-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const assert = require('assert');
const isjQueryObj = require('../../lib/utils/is-jquery-obj').default;

describe('is-jquery-obj test', () => {
it('Should define jquery object correctly', () => {
assert.equal(isjQueryObj(void 0), false);
assert.equal(isjQueryObj({}), false);
assert.equal(isjQueryObj({ jquery: {} }), true);
});
});

0 comments on commit f8d93a5

Please sign in to comment.