Skip to content

Commit

Permalink
chore: add prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Nov 14, 2019
1 parent decdbd5 commit dd33776
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"trailingComma": "none",
"tabWidth": 2,
"semi": false,
"singleQuote": true
"singleQuote": true,
"bracketSpacing": true
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"semantic-release": "semantic-release",
"test:ci": "start-test 1234",
"report:coverage": "nyc report --reporter=html",
"dev:no:coverage": "start-test 1234 'cypress open --env coverage=false'"
"dev:no:coverage": "start-test 1234 'cypress open --env coverage=false'",
"format": "prettier --write '*.js'"
},
"peerDependencies": {
"cypress": "*",
Expand Down
8 changes: 4 additions & 4 deletions task.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const pkg = fs.existsSync(pkgFilename)
: {}
const nycOptions = pkg.nyc || {}

function saveCoverage (coverage) {
function saveCoverage(coverage) {
if (!existsSync(coverageFolder)) {
mkdirSync(coverageFolder)
debug('created folder %s for output coverage', coverageFolder)
Expand All @@ -42,7 +42,7 @@ module.exports = {
* - runs EACH spec separately, so we cannot reset the coverage
* or we will lose the coverage from previous specs.
*/
resetCoverage ({ isInteractive }) {
resetCoverage({ isInteractive }) {
if (isInteractive) {
debug('reset code coverage in interactive mode')
const coverageMap = istanbul.createCoverageMap({})
Expand All @@ -62,7 +62,7 @@ module.exports = {
* Combines coverage information from single test
* with previously collected coverage.
*/
combineCoverage (coverage) {
combineCoverage(coverage) {
fixSourcePathes(coverage)
const previous = existsSync(nycFilename)
? JSON.parse(readFileSync(nycFilename))
Expand All @@ -79,7 +79,7 @@ module.exports = {
* Saves coverage information as a JSON file and calls
* NPM script to generate HTML report
*/
coverageReport () {
coverageReport() {
if (!existsSync(nycFilename)) {
console.warn('Cannot find coverage file %s', nycFilename)
console.warn('Skipping coverage report')
Expand Down

0 comments on commit dd33776

Please sign in to comment.