From f10f29cf1d84c3aa324d248686c672660d1bc07d Mon Sep 17 00:00:00 2001 From: Joshua Date: Tue, 13 Sep 2022 16:03:57 +0200 Subject: [PATCH] cleanup --- cypress/snapshots/Fixture-File.json | 1 + src/add-initial-snapshot-file.js | 25 ------------------------- src/index.js | 6 +++--- 3 files changed, 4 insertions(+), 28 deletions(-) create mode 100644 cypress/snapshots/Fixture-File.json delete mode 100644 src/add-initial-snapshot-file.js diff --git a/cypress/snapshots/Fixture-File.json b/cypress/snapshots/Fixture-File.json new file mode 100644 index 0000000..86ac8e3 --- /dev/null +++ b/cypress/snapshots/Fixture-File.json @@ -0,0 +1 @@ +{"foo":"bar","Fizzy Drink":"Soda"} \ No newline at end of file diff --git a/src/add-initial-snapshot-file.js b/src/add-initial-snapshot-file.js deleted file mode 100644 index f637dcf..0000000 --- a/src/add-initial-snapshot-file.js +++ /dev/null @@ -1,25 +0,0 @@ -const debug = require('debug')('@cypress/snapshot') -const fs = require('fs') -const path = require('path') -const utils = require('./utils') -const amDependency = require('am-i-a-dependency')() - -if (amDependency) { - // yes, do something interesting - // someone is executing "npm install foo" - debug('post install - in folder', process.cwd()) - // we are in /node_modules/@cypress/snapshot - // but want to be simply in folder - const ownerFolder = path.normalize(path.join(process.cwd(), '..', '..', '..')) - const filename = path.join(ownerFolder, utils.SNAPSHOT_FILE_NAME) - - if (!fs.existsSync(filename)) { - // save initial empty snapshot object - debug('writing initial file', filename) - fs.writeFileSync(filename, '{}\n') - } else { - debug('file %s already exists', filename) - } -} else { - debug('not a dependency install') -} diff --git a/src/index.js b/src/index.js index 83d196f..1a41799 100644 --- a/src/index.js +++ b/src/index.js @@ -1,10 +1,10 @@ -"use strict"; +'use strict' // global cy, Cypress -const { functions } = require("./utils/index"); +const { functions } = require('./utils/index') module.exports = { register: functions.register, tasks: functions.tasks -}; +}