Skip to content

Commit

Permalink
Merge pull request #3 from clocklimited/feature/up-ncp-limit
Browse files Browse the repository at this point in the history
Feature/up ncp limit
  • Loading branch information
microadam committed Oct 24, 2016
2 parents 97aa399 + 2933141 commit 56b7116
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 23 deletions.
5 changes: 0 additions & 5 deletions .jscsrc
Expand Up @@ -4,10 +4,8 @@
]
, "requireLineFeedAtFileEnd": true
, "disallowMultipleLineBreaks": true
, "requireMultipleVarDecl": true
, "disallowEmptyBlocks": true
, "disallowSpaceAfterObjectKeys": true
, "disallowCommaBeforeLineBreak": true
, "disallowTrailingWhitespace": true
, "requireCapitalizedConstructors": true
, "requireSpacesInsideObjectBrackets": "all"
Expand All @@ -16,13 +14,10 @@
, "requireSpaceBeforeBinaryOperators": [ "+", "-", "/", "*", "=", "==", "===", "!=", "!==" ]
, "requireSpaceAfterBinaryOperators": [ "+", "-", "/", "*", "=", "==", "===", "!=", "!==" ]
, "requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "try", "catch" ]
, "disallowLeftStickedOperators": [ "?", "+", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=" ]
, "disallowRightStickedOperators": [ "?", "+", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=" ]
, "disallowSpaceAfterPrefixUnaryOperators": [ "++", "--", "+", "-", "~", "!" ]
, "disallowSpaceBeforePostfixUnaryOperators": [ "++", "--" ]
, "requireSpaceBeforeBinaryOperators": [ "+", "-", "/", "*", "=", "==", "===", "!=", "!==" ]
, "requireSpaceAfterBinaryOperators": [ "+", "-", "/", "*", "=", "==", "===", "!=", "!==" ]
, "disallowKeywordsOnNewLine": [ "else" ]
, "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }
}

7 changes: 7 additions & 0 deletions .jsinspectrc
@@ -0,0 +1,7 @@
{
"threshold": 30,
"identifiers": true,
"ignore": "test|build|lib/vendor",
"reporter": "default",
"suppress": 100
}
2 changes: 1 addition & 1 deletion lib/prepare-to-build.js
Expand Up @@ -10,7 +10,7 @@ module.exports = function createPrepareToBuild() {
}
context.emit('Copying prepare directory to build directory')
context.emit('cp -r ' + data.prepareDir + ' ' + data.finalBuildDir)
copy(data.prepareDir, data.finalBuildDir, function (error) {
copy(data.prepareDir, data.finalBuildDir, { limit: 256 }, function (error) {
callback(error, data)
})
}
Expand Down
22 changes: 12 additions & 10 deletions package.json
Expand Up @@ -10,25 +10,27 @@
"registry": "http://registry.npmjs.org"
},
"scripts": {
"lint": "./node_modules/.bin/jshint . --reporter=./node_modules/jshint-full-path/index.js",
"jscs": "./node_modules/.bin/jscs .",
"pretest": "npm run-script lint && npm run-script jscs",
"test": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --recursive -R spec -r should",
"posttest": "./node_modules/.bin/istanbul check-coverage && rm -rf coverage"
"lint": "jshint . --reporter=./node_modules/jshint-full-path/index.js",
"jscs": "jscs .",
"inspect": "jsinspect .",
"pretest": "npm run lint && npm run jscs && npm run inspect",
"test": "istanbul cover ./node_modules/.bin/_mocha -- --recursive -R spec -r should",
"posttest": "istanbul check-coverage && rm -rf coverage"
},
"dependencies": {
"async": "~0.2.10",
"express": "^4.4.5",
"extend": "^1.2.1",
"async": "^2.1.2",
"express": "^4.14.0",
"extend": "^3.0.0",
"hat": "0.0.3",
"ncp": "^0.5.0",
"rmdir": "^1.0.4"
"ncp": "^2.0.0",
"rmdir": "^1.2.0"
},
"devDependencies": {
"istanbul": "~0.2.3",
"jscs": "~1.3",
"jshint": "~2.4.1",
"jshint-full-path": "~1.1.1",
"jsinspect": "^0.8.0",
"mocha": "~1.17.0",
"rewire": "^2.0.0",
"should": "~3.0.1",
Expand Down
16 changes: 9 additions & 7 deletions test/lib/prepare-to-build.test.js
Expand Up @@ -6,11 +6,14 @@ var sinon = require('sinon')

describe('prepare-to-build', function () {

before(function (done) {
fs.mkdir('/tmp/navy-clock-build-test', function () {
fs.writeFile('/tmp/navy-clock-build-test/test', 'hello', function () {
fs.mkdir('/tmp/navy-clock-build/', done)
})
before(function () {
fs.mkdirSync('/tmp/navy-clock-build-test')
fs.mkdirSync('/tmp/navy-clock-build')
var payload = (new Array(3000)).fill(1).map(function (v, i) { return i })
, content = payload.join()
payload.forEach(function (v) {
fs.mkdirSync('/tmp/navy-clock-build-test/dir_' + v)
fs.writeFileSync('/tmp/navy-clock-build-test/dir_' + v + '/test', content)
})
})

Expand All @@ -25,7 +28,7 @@ describe('prepare-to-build', function () {
prepareToBuild(context, data, function (error) {
should.not.exist(error)
emitSpy.calledTwice.should.equal(true)
var filePath = '/tmp/navy-clock-build/test'
var filePath = '/tmp/navy-clock-build/dir_0/test'
fs.exists(filePath, function (fileExists) {
fileExists.should.equal(true, filePath + ' does not exist')
done()
Expand Down Expand Up @@ -53,5 +56,4 @@ describe('prepare-to-build', function () {
})
})
})

})

0 comments on commit 56b7116

Please sign in to comment.