Skip to content

Commit

Permalink
Remove Grunt, replace QUnit by Jest
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 committed Dec 3, 2019
1 parent f916b44 commit 4a2c42d
Show file tree
Hide file tree
Showing 15 changed files with 436 additions and 562 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: prepare
run: |
npm install -g grunt-cli
npm install -g bower
- name: build
run: |
npm install
npm run compile
npm run test
grunt coveralls
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/bower_components
/node_modules
/.coverage-results
/.idea
/*.iml
yarn.lock
79 changes: 0 additions & 79 deletions Gruntfile.js

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[![npm version](https://img.shields.io/npm/v/jquery-extendext.svg?style=flat-square)](https://www.npmjs.com/package/jquery-extendext)
[![jsDelivr CDN](https://data.jsdelivr.com/v1/package/npm/jquery-extendext/badge)](https://www.jsdelivr.com/package/npm/jquery-extendext)
[![Build Status](https://github.com/mistic100/jQuery.extendext/workflows/CI/badge.svg)](https://github.com/mistic100/jQuery.extendext/actions)
[![Coverage Status](https://coveralls.io/repos/mistic100/jQuery.extendext/badge.svg)](https://coveralls.io/r/mistic100/jQuery.extendext)

jQuery.extend with configurable behaviour for arrays.

Expand Down Expand Up @@ -128,6 +127,6 @@ assert.deepEqual(config, {

## Tests

A QUnit test suite is provided in `tests` directory.
A jest test suite is provided in `tests` directory.

`$.extendext` is tested against core jQuery tests for `$.extend` and `nrf110/deepmerge` tests (with the difference that extendext, like extend, modifies the first argument where deepmerge does not touch it).
36 changes: 0 additions & 36 deletions bower.json

This file was deleted.

9 changes: 0 additions & 9 deletions jQuery.extendext.min.js

This file was deleted.

24 changes: 12 additions & 12 deletions jQuery.extendext.js → jquery-extendext.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
/*!
* jQuery.extendext 0.1.2
* jQuery.extendext 1.0.0
*
* Copyright 2014-2016 Damien "Mistic" Sorel (http://www.strangeplanet.fr)
* Copyright 2014-2019 Damien "Mistic" Sorel (http://www.strangeplanet.fr)
* Licensed under MIT (http://opensource.org/licenses/MIT)
*
* Based on jQuery.extend by jQuery Foundation, Inc. and other contributors
*/

/*jshint -W083 */

(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
Expand Down Expand Up @@ -94,25 +92,27 @@
} else {
// Extend the base object
for (name in options) {
src = target[name];
copy = options[name];

// Prevent never-ending loop
if (target === copy) {
if (name === '__proto__' || target === copy) {
continue;
}

// Recurse if we're merging plain objects or arrays
if (deep && copy && ( $.isPlainObject(copy) ||
(copyIsArray = $.isArray(copy)) )) {
src = target[name];

if (copyIsArray) {
copyIsArray = false;
clone = src && $.isArray(src) ? src : [];

// Ensure proper type for the source value
if ( copyIsArray && !Array.isArray( src ) ) {
clone = [];
} else if ( !copyIsArray && !$.isPlainObject( src ) ) {
clone = {};
} else {
clone = src && $.isPlainObject(src) ? src : {};
clone = src;
}
copyIsArray = false;

// Never move original objects, clone them
target[name] = $.extendext(deep, arrayMode, clone, copy);
Expand All @@ -129,4 +129,4 @@
// Return the modified object
return target;
};
}));
}));
29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
{
"name": "jquery-extendext",
"version": "0.1.2",
"version": "1.0.0",
"description": "jQuery.extend with configurable behaviour for arrays",
"authors": [{
"name": "Damien \"Mistic\" Sorel",
"email": "[email protected]",
"homepage": "http://www.strangeplanet.fr"
}],
"main": "jQuery.extendext.js",
"authors": [
{
"name": "Damien \"Mistic\" Sorel",
"email": "[email protected]",
"homepage": "http://www.strangeplanet.fr"
}
],
"main": "jquery-extendext.js",
"files": [
"jquery-extendext.js"
],
"dependencies": {
"jquery": ">=1.9.1"
},
"devDependencies": {
"grunt": "~1.0.0",
"grunt-contrib-qunit": "~0.7.0",
"grunt-contrib-uglify": "~1.0.0",
"grunt-contrib-jshint": "~1.0.0",
"grunt-qunit-blanket-lcov": "~0.3.1",
"grunt-coveralls": "~1.0.0"
"jest": "^24.9.0",
"jest-expect-message": "^1.0.2"
},
"keywords": [
"jQuery",
Expand All @@ -34,6 +35,6 @@
"url": "https://github.com/mistic100/jQuery.extendext/issues"
},
"scripts": {
"test": "grunt test"
"test": "jest tests/*.spec.js"
}
}
Loading

0 comments on commit 4a2c42d

Please sign in to comment.