Skip to content

Commit

Permalink
- Update versions of dependencies: browserify, eslint, uglify-js
Browse files Browse the repository at this point in the history
- Replace coverage tools: istanbul, istanbul-coveralls => nyc, coveralls
- Modify commands of `scripts` in package.json
  • Loading branch information
sttk committed May 13, 2018
1 parent 84a2414 commit 623b0bc
Show file tree
Hide file tree
Showing 7 changed files with 553 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ npm-debug.log*

# Coverage directory used by tools like istanbul
coverage
.nyc_output
.coveralls.yml

# Dependency directories
node_modules
Expand Down
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
"scripts": {
"lint": "eslint .",
"test": "mocha",
"coverage": "istanbul cover _mocha",
"coveralls": "istanbul cover _mocha && istanbul-coveralls",
"web:install": "npm install --no-save phantomjs-prebuilt mocha-phantomjs",
"web:build": "browserify index.js --standalone copyProps | uglifyjs --compress --mangle -o web/copy-props.js && node test/web/make.js",
"web:test": "mocha-phantomjs -p node_modules/.bin/phantomjs test/web/copy-props.test.html"
"coverage": "nyc --reporter=lcov --reporter=text-summary npm test",
"coveralls": "nyc --reporter=text-lcov npm test | coveralls",
"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",
"chrome:install": "npm i --no-save mocha-chrome",
"chrome:test": "mocha-chrome test/web/browser-test.html",
"build": "npm run lint && npm run coverage && npm run web:build && node test/web/make.js"
},
"repository": {
"type": "git",
Expand All @@ -38,12 +39,12 @@
"is-plain-object": "^2.0.1"
},
"devDependencies": {
"browserify": "^14.1.0",
"browserify": "^16.2.2",
"chai": "^3.5.0",
"eslint": "^3.16.1",
"istanbul": "^0.4.5",
"istanbul-coveralls": "^1.0.3",
"coveralls": "^3.0.1",
"eslint": "^4.19.1",
"mocha": "^3.2.0",
"uglify-js": "^2.8.1"
"nyc": "^11.7.2",
"uglify-js": "^3.3.24"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link href="../../node_modules/mocha/mocha.css" rel="stylesheet"/>
<script src="../../node_modules/mocha/mocha.js"></script>
<script src="../../node_modules/chai/chai.js"></script>
<script src="../../web/copy-props.js"></script>
<script src="../../web/copy-props.min.js"></script>
</head>
<body>
<div id="mocha"></div>
Expand Down
13 changes: 13 additions & 0 deletions test/web/copy-props-proc.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,19 @@ describe('Processing', function() {
var dst = { a: { b: { c: 1 } } };
expect(copyProps(src, dst)).to.deep.equal({ a: { b: { c: 1 } } });
});

it('Should copy normally when src prop is not a plain object but an ' +
'object', function() {
function O(v) {
this.a = { b: { c: v } };
}
var o1 = new O(123);
var o2 = new O(456);
var p1 = { o: o1 };
var p2 = { o: o2 };
copyProps(p1, p2);
expect(p2.o).to.equal(o1);
});
});

describe('About fromto special cases', function() {
Expand Down
Loading

0 comments on commit 623b0bc

Please sign in to comment.