Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
chore: fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
imurchie committed Jan 7, 2019
1 parent 3506559 commit 5313ca6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use strict";
'use strict';

const gulp = require('gulp');
const boilerplate = require('appium-gulp-plugins').boilerplate.use(gulp);
Expand Down
2 changes: 1 addition & 1 deletion lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let fs = {
try {
await _mkdir(dirName);
} catch (err) {
if (err && err.code !== "EEXIST") {
if (err && err.code !== 'EEXIST') {
throw err;
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/image-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const AVAILABLE_MATCHING_FUNCTIONS = [
async function getJimpImage (data) {
return await new B((resolve, reject) => {
if (!_.isString(data) && !_.isBuffer(data)) {
return reject(new Error("Must initialize jimp object with string or buffer"));
return reject(new Error('Must initialize jimp object with string or buffer'));
}
// if data is a string, assume it is a base64-encoded image
if (_.isString(data)) {
Expand All @@ -78,7 +78,7 @@ async function getJimpImage (data) {
return reject(err);
}
if (!imgObj) {
return reject(new Error("Could not create jimp image from that data"));
return reject(new Error('Could not create jimp image from that data'));
}
imgObj._getBuffer = imgObj.getBuffer.bind(imgObj);
imgObj.getBuffer = B.promisify(imgObj._getBuffer, {context: imgObj});
Expand Down
8 changes: 4 additions & 4 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import fs from './fs';
const W3C_WEB_ELEMENT_IDENTIFIER = 'element-6066-11e4-a52e-4f735466cecf';

export function hasContent (val) {
return _.isString(val) && val !== "";
return _.isString(val) && val !== '';
}

// return true if the the value is not undefined, null, or NaN.
Expand All @@ -29,10 +29,10 @@ function escapeSpace (str) {
}

function escapeSpecialChars (str, quoteEscape) {
if (typeof str !== "string") {
if (typeof str !== 'string') {
return str;
}
if (typeof quoteEscape === "undefined") {
if (typeof quoteEscape === 'undefined') {
quoteEscape = false;
}
str = str
Expand All @@ -46,7 +46,7 @@ function escapeSpecialChars (str, quoteEscape) {
.replace(/[\"]/g, '\\"') // eslint-disable-line no-useless-escape
.replace(/\\'/g, "\\'");
if (quoteEscape) {
let re = new RegExp(quoteEscape, "g");
let re = new RegExp(quoteEscape, 'g');
str = str.replace(re, `\\${quoteEscape}`);
}
return str;
Expand Down
16 changes: 8 additions & 8 deletions test/fs-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ let should = chai.should();

describe('fs', function () {
const existingPath = path.resolve(__dirname, 'fs-specs.js');
it("should exist", function () {
it('should exist', function () {
should.exist(fs);
});
it("should have expected methods", function () {
it('should have expected methods', function () {
should.exist(fs.open);
should.exist(fs.close);
should.exist(fs.access);
Expand All @@ -25,24 +25,24 @@ describe('fs', function () {
should.exist(fs.mv);
});

describe("mkdir", function () {
let dirName = path.resolve(__dirname, "tmp");
describe('mkdir', function () {
let dirName = path.resolve(__dirname, 'tmp');

it("should make a directory that does not exist", async function () {
it('should make a directory that does not exist', async function () {
await fs.rimraf(dirName);
await fs.mkdir(dirName);
let exists = await fs.hasAccess(dirName);
exists.should.be.true;
});

it("should not complain if the dir already exists", async function () {
it('should not complain if the dir already exists', async function () {
let exists = await fs.hasAccess(dirName);
exists.should.be.true;
await fs.mkdir(dirName);
});

it("should still throw an error if something else goes wrong", async function () {
await fs.mkdir("/bin/foo").should.be.rejected;
it('should still throw an error if something else goes wrong', async function () {
await fs.mkdir('/bin/foo').should.be.rejected;
});
});

Expand Down

0 comments on commit 5313ca6

Please sign in to comment.