Skip to content

Commit

Permalink
add is-jquery-obj function
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelMor25 committed Apr 23, 2024
1 parent 4c01bbe commit a4588c0
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
11 changes: 0 additions & 11 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
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 a4588c0

Please sign in to comment.