Skip to content

Commit 623b0bc

Browse files
committed
- Update versions of dependencies: browserify, eslint, uglify-js
- Replace coverage tools: istanbul, istanbul-coveralls => nyc, coveralls - Modify commands of `scripts` in package.json
1 parent 84a2414 commit 623b0bc

7 files changed

+553
-12
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ npm-debug.log*
55

66
# Coverage directory used by tools like istanbul
77
coverage
8+
.nyc_output
9+
.coveralls.yml
810

911
# Dependency directories
1012
node_modules

package.json

+11-10
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
"scripts": {
1010
"lint": "eslint .",
1111
"test": "mocha",
12-
"coverage": "istanbul cover _mocha",
13-
"coveralls": "istanbul cover _mocha && istanbul-coveralls",
14-
"web:install": "npm install --no-save phantomjs-prebuilt mocha-phantomjs",
15-
"web:build": "browserify index.js --standalone copyProps | uglifyjs --compress --mangle -o web/copy-props.js && node test/web/make.js",
16-
"web:test": "mocha-phantomjs -p node_modules/.bin/phantomjs test/web/copy-props.test.html"
12+
"coverage": "nyc --reporter=lcov --reporter=text-summary npm test",
13+
"coveralls": "nyc --reporter=text-lcov npm test | coveralls",
14+
"web:build": "browserify index.js --standalone copyProps -o web/copy-props.js && cd web && uglifyjs copy-props.js --compress --mangle -o copy-props.min.js --source-map url=copy-props.min.js.map",
15+
"chrome:install": "npm i --no-save mocha-chrome",
16+
"chrome:test": "mocha-chrome test/web/browser-test.html",
17+
"build": "npm run lint && npm run coverage && npm run web:build && node test/web/make.js"
1718
},
1819
"repository": {
1920
"type": "git",
@@ -38,12 +39,12 @@
3839
"is-plain-object": "^2.0.1"
3940
},
4041
"devDependencies": {
41-
"browserify": "^14.1.0",
42+
"browserify": "^16.2.2",
4243
"chai": "^3.5.0",
43-
"eslint": "^3.16.1",
44-
"istanbul": "^0.4.5",
45-
"istanbul-coveralls": "^1.0.3",
44+
"coveralls": "^3.0.1",
45+
"eslint": "^4.19.1",
4646
"mocha": "^3.2.0",
47-
"uglify-js": "^2.8.1"
47+
"nyc": "^11.7.2",
48+
"uglify-js": "^3.3.24"
4849
}
4950
}

test/web/copy-props.test.html renamed to test/web/browser-test.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<link href="../../node_modules/mocha/mocha.css" rel="stylesheet"/>
77
<script src="../../node_modules/mocha/mocha.js"></script>
88
<script src="../../node_modules/chai/chai.js"></script>
9-
<script src="../../web/copy-props.js"></script>
9+
<script src="../../web/copy-props.min.js"></script>
1010
</head>
1111
<body>
1212
<div id="mocha"></div>

test/web/copy-props-proc.js

+13
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,19 @@ describe('Processing', function() {
166166
var dst = { a: { b: { c: 1 } } };
167167
expect(copyProps(src, dst)).to.deep.equal({ a: { b: { c: 1 } } });
168168
});
169+
170+
it('Should copy normally when src prop is not a plain object but an ' +
171+
'object', function() {
172+
function O(v) {
173+
this.a = { b: { c: v } };
174+
}
175+
var o1 = new O(123);
176+
var o2 = new O(456);
177+
var p1 = { o: o1 };
178+
var p2 = { o: o2 };
179+
copyProps(p1, p2);
180+
expect(p2.o).to.equal(o1);
181+
});
169182
});
170183

171184
describe('About fromto special cases', function() {

0 commit comments

Comments
 (0)