From 6ce5b4da216e2d2476542de32aef08ec85e0542a Mon Sep 17 00:00:00 2001 From: svipben Date: Sat, 17 Feb 2018 16:40:05 +0200 Subject: [PATCH 01/10] Improved `clear()` function to also reject Promise or execute callback --- index.js | 12 ++++++++---- tests/index.test.js | 22 +++++++++++++++------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/index.js b/index.js index 030713b..c0620c0 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ const cache = new Map(); -const timeouts = []; +const timeouts = new Map(); /** * Returns value from cache by given `key`. @@ -76,7 +76,11 @@ function entries() { * @returns {number} how much elements was removed from cache */ function clear() { - timeouts.forEach(t => clearTimeout(t)); + timeouts.forEach((callback, timeout) => { + clearTimeout(timeout); + callback(); + }); + const length = size(); cache.clear(); return length; @@ -139,7 +143,7 @@ function put(key, value, timeout, callback) { reject(new Error(`${key} does not exist`)); } }, timeout); - timeouts.push(t); + timeouts.set(t, () => reject(new Error(`${key} timeout was cleared`))); }); } @@ -152,7 +156,7 @@ function put(key, value, timeout, callback) { callback(new Error(`${key} does not exist`)); } }, timeout); - timeouts.push(t); + timeouts.set(t, () => callback(new Error(`${key} timeout was cleared`))); } return true; diff --git a/tests/index.test.js b/tests/index.test.js index 4ae14da..07aa89c 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -82,6 +82,7 @@ test('callback', done => { test('element remove before timeout', done => { cachimo.put('key', 'value', 500, err => { + expect(err).toBeInstanceOf(Error); expect(err.message).toBe('key does not exist'); done(); }); @@ -89,15 +90,22 @@ test('element remove before timeout', done => { const promise = cachimo.put('key', 'value', 1000); cachimo.remove('key'); - promise.catch(err => expect(err.message).toBe('key does not exist')); + promise.catch(err => { + expect(err).toBeInstanceOf(Error); + expect(err.message).toBe('key does not exist'); + }); }); test('clear all timeouts', () => { - cachimo.put('key', 'value', 1000); - cachimo.clear(); + cachimo.put('promiseKey', 'promiseValue', 1000).catch(err => { + expect(err).toBeInstanceOf(Error); + expect(err.message).toBe('promiseKey timeout was cleared'); + }); - expect(cachimo.put('key', 'value')).toBeTruthy(); - expect(cachimo.has('key')).toBeTruthy(); - expect(cachimo.get('key')).toBe('value'); - expect(cachimo.size()).toBe(1); + cachimo.put('cbKey', 'cbValue', 2000, err => { + expect(err).toBeInstanceOf(Error); + expect(err.message).toBe('cbKey timeout was cleared'); + }); + + cachimo.clear(); }); From c80ca998e1cdc71e3bd352eb04ac18acb5ad1f80 Mon Sep 17 00:00:00 2001 From: svipben Date: Sat, 17 Feb 2018 16:40:59 +0200 Subject: [PATCH 02/10] Updated package version and "devDependencies" --- CHANGELOG.md | 13 ++ package.json | 6 +- yarn.lock | 431 ++++++++++++++++++++++++++------------------------- 3 files changed, 235 insertions(+), 215 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56a2f2b..d92335e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## [1.0.4](https://github.com/svipben/cachimo/releases/tag/1.0.4) (2018-02-17) + +### Improved + +* `clear()` function to also reject Promise or execute callback to inform if timeout was cleared. +* `README.md` to show how new `clear()` function works. +* Travis CI to also run ESLint before tests. + +### Updated + +* ⬆️ ESLint to 4.18.0 +* ⬆️ Jest to 22.3.0 + ## [1.0.3](https://github.com/svipben/cachimo/releases/tag/1.0.3) (2018-02-17) ### Added diff --git a/package.json b/package.json index 879b60a..797ca24 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cachimo", "description": "Stores key with value in-memory and can be deleted manually or after given timeout.", - "version": "1.0.3", + "version": "1.0.4", "main": "index.js", "repository": "https://github.com/svipben/cachimo.git", "author": "svipben ", @@ -11,8 +11,8 @@ "test": "jest tests" }, "devDependencies": { - "eslint": "^4.16.0", - "jest": "^22.1.4" + "eslint": "^4.18.0", + "jest": "^22.3.0" }, "keywords": ["cache", "in-memory", "storage"] } diff --git a/yarn.lock b/yarn.lock index be67bfa..049233a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,8 +3,14 @@ "@babel/code-frame@^7.0.0-beta.35": - version "7.0.0-beta.38" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.38.tgz#c0af5930617e55e050336838e3a3670983b0b2b2" + version "7.0.0-beta.40" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.40.tgz#37e2b0cf7c56026b4b21d3927cadf81adec32ac6" + dependencies: + "@babel/highlight" "7.0.0-beta.40" + +"@babel/highlight@7.0.0-beta.40": + version "7.0.0-beta.40" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.40.tgz#b43d67d76bf46e1d10d227f68cddcd263786b255" dependencies: chalk "^2.0.0" esutils "^2.0.2" @@ -34,9 +40,9 @@ acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" -acorn@^5.0.0, acorn@^5.2.1, acorn@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.3.0.tgz#7446d39459c54fb49a80e6ee6478149b940ec822" +acorn@^5.0.0, acorn@^5.3.0, acorn@^5.4.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.4.1.tgz#fdc58d9d17f4a4e98d102ded826a9b9759125102" ajv-keywords@^2.1.0: version "2.1.1" @@ -86,7 +92,7 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -ansi-styles@^3.1.0, ansi-styles@^3.2.0: +ansi-styles@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" dependencies: @@ -117,8 +123,8 @@ are-we-there-yet@~1.1.2: readable-stream "^2.0.6" argparse@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" dependencies: sprintf-js "~1.0.2" @@ -233,8 +239,8 @@ babel-core@^6.0.0, babel-core@^6.26.0: source-map "^0.5.6" babel-generator@^6.18.0, babel-generator@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.0.tgz#ac1ae20070b79f6e3ca1d3269613053774f20dc5" + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" dependencies: babel-messages "^6.23.0" babel-runtime "^6.26.0" @@ -242,7 +248,7 @@ babel-generator@^6.18.0, babel-generator@^6.26.0: detect-indent "^4.0.0" jsesc "^1.3.0" lodash "^4.17.4" - source-map "^0.5.6" + source-map "^0.5.7" trim-right "^1.0.1" babel-helpers@^6.24.1: @@ -252,12 +258,12 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-jest@^22.1.0: - version "22.1.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-22.1.0.tgz#7fae6f655fffe77e818a8c2868c754a42463fdfd" +babel-jest@^22.2.2: + version "22.2.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-22.2.2.tgz#eda38dca284e32cc5257f96a9b51351975de4e04" dependencies: babel-plugin-istanbul "^4.1.5" - babel-preset-jest "^22.1.0" + babel-preset-jest "^22.2.0" babel-messages@^6.23.0: version "6.23.0" @@ -273,19 +279,19 @@ babel-plugin-istanbul@^4.1.5: istanbul-lib-instrument "^1.7.5" test-exclude "^4.1.1" -babel-plugin-jest-hoist@^22.1.0: - version "22.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.1.0.tgz#c1281dd7887d77a1711dc760468c3b8285dde9ee" +babel-plugin-jest-hoist@^22.2.0: + version "22.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.2.0.tgz#bd34f39d652406669713b8c89e23ef25c890b993" babel-plugin-syntax-object-rest-spread@^6.13.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" -babel-preset-jest@^22.1.0: - version "22.1.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-22.1.0.tgz#ff4e704102f9642765e2254226050561d8942ec9" +babel-preset-jest@^22.2.0: + version "22.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-22.2.0.tgz#f77b43f06ef4d8547214b2e206cc76a25c3ba0e2" dependencies: - babel-plugin-jest-hoist "^22.1.0" + babel-plugin-jest-hoist "^22.2.0" babel-plugin-syntax-object-rest-spread "^6.13.0" babel-register@^6.26.0: @@ -379,8 +385,8 @@ boom@5.x.x: hoek "4.x.x" brace-expansion@^1.1.7: - version "1.1.8" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" dependencies: balanced-match "^1.0.0" concat-map "0.0.1" @@ -457,12 +463,12 @@ chalk@^1.1.3: supports-color "^2.0.0" chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" + version "2.3.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" dependencies: - ansi-styles "^3.1.0" + ansi-styles "^3.2.0" escape-string-regexp "^1.0.5" - supports-color "^4.0.0" + supports-color "^5.2.0" chardet@^0.4.0: version "0.4.2" @@ -520,9 +526,9 @@ color-name@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" -combined-stream@^1.0.5, combined-stream@~1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" +combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" dependencies: delayed-stream "~1.0.0" @@ -737,9 +743,9 @@ eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" -eslint@^4.16.0: - version "4.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.16.0.tgz#934ada9e98715e1d7bbfd6f6f0519ed2fab35cc1" +eslint@^4.18.0: + version "4.18.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.18.0.tgz#ebd0ba795af6dc59aa5cee17938160af5950e051" dependencies: ajv "^5.3.0" babel-code-frame "^6.22.0" @@ -780,10 +786,10 @@ eslint@^4.16.0: text-table "~0.2.0" espree@^3.5.2: - version "3.5.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.2.tgz#756ada8b979e9dcfcdb30aad8d1a9304a905e1ca" + version "3.5.3" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.3.tgz#931e0af64e7fbbed26b050a29daad1fc64799fa6" dependencies: - acorn "^5.2.1" + acorn "^5.4.0" acorn-jsx "^3.0.0" esprima@^3.1.3: @@ -849,15 +855,15 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" -expect@^22.1.0: - version "22.1.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-22.1.0.tgz#f8f9b019ab275d859cbefed531fbaefe8972431d" +expect@^22.3.0: + version "22.3.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-22.3.0.tgz#b1cb7db27a951ab6055f43937277152a9f668028" dependencies: ansi-styles "^3.2.0" jest-diff "^22.1.0" jest-get-type "^22.1.0" - jest-matcher-utils "^22.1.0" - jest-message-util "^22.1.0" + jest-matcher-utils "^22.2.0" + jest-message-util "^22.2.0" jest-regex-util "^22.1.0" extend@~3.0.0, extend@~3.0.1: @@ -987,11 +993,11 @@ form-data@~2.1.1: mime-types "^2.1.12" form-data@~2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.1.tgz#6fb94fbd71885306d73d15cc497fe4cc4ecd44bf" + version "2.3.2" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" dependencies: asynckit "^0.4.0" - combined-stream "^1.0.5" + combined-stream "1.0.6" mime-types "^2.1.12" fs.realpath@^1.0.0: @@ -1082,8 +1088,8 @@ glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2: path-is-absolute "^1.0.0" globals@^11.0.1: - version "11.2.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.2.0.tgz#aa2ece052a787563ba70a3dcd9dc2eb8a9a0488c" + version "11.3.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.3.0.tgz#e04fdb7b9796d8adac9c8f64c14837b2313378b0" globals@^9.18.0: version "9.18.0" @@ -1150,9 +1156,9 @@ has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" -has-flag@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" has-unicode@^2.0.0: version "2.0.1" @@ -1187,8 +1193,8 @@ hoek@2.x.x: resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" hoek@4.x.x: - version "4.2.0" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" + version "4.2.1" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" home-or-tmp@^2.0.0: version "2.0.0" @@ -1443,24 +1449,24 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" istanbul-api@^1.1.14: - version "1.2.1" - resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.2.1.tgz#0c60a0515eb11c7d65c6b50bba2c6e999acd8620" + version "1.2.2" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.2.2.tgz#e17cd519dd5ec4141197f246fdf380b75487f3b1" dependencies: async "^2.1.4" fileset "^2.0.2" - istanbul-lib-coverage "^1.1.1" + istanbul-lib-coverage "^1.1.2" istanbul-lib-hook "^1.1.0" - istanbul-lib-instrument "^1.9.1" - istanbul-lib-report "^1.1.2" - istanbul-lib-source-maps "^1.2.2" - istanbul-reports "^1.1.3" + istanbul-lib-instrument "^1.9.2" + istanbul-lib-report "^1.1.3" + istanbul-lib-source-maps "^1.2.3" + istanbul-reports "^1.1.4" js-yaml "^3.7.0" mkdirp "^0.5.1" once "^1.4.0" -istanbul-lib-coverage@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da" +istanbul-lib-coverage@^1.1.1, istanbul-lib-coverage@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.2.tgz#4113c8ff6b7a40a1ef7350b01016331f63afde14" istanbul-lib-hook@^1.1.0: version "1.1.0" @@ -1468,52 +1474,52 @@ istanbul-lib-hook@^1.1.0: dependencies: append-transform "^0.4.0" -istanbul-lib-instrument@^1.7.5, istanbul-lib-instrument@^1.8.0, istanbul-lib-instrument@^1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.1.tgz#250b30b3531e5d3251299fdd64b0b2c9db6b558e" +istanbul-lib-instrument@^1.7.5, istanbul-lib-instrument@^1.8.0, istanbul-lib-instrument@^1.9.2: + version "1.9.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.2.tgz#84905bf47f7e0b401d6b840da7bad67086b4aab6" dependencies: babel-generator "^6.18.0" babel-template "^6.16.0" babel-traverse "^6.18.0" babel-types "^6.18.0" babylon "^6.18.0" - istanbul-lib-coverage "^1.1.1" + istanbul-lib-coverage "^1.1.2" semver "^5.3.0" -istanbul-lib-report@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.2.tgz#922be27c13b9511b979bd1587359f69798c1d425" +istanbul-lib-report@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.3.tgz#2df12188c0fa77990c0d2176d2d0ba3394188259" dependencies: - istanbul-lib-coverage "^1.1.1" + istanbul-lib-coverage "^1.1.2" mkdirp "^0.5.1" path-parse "^1.0.5" supports-color "^3.1.2" -istanbul-lib-source-maps@^1.2.1, istanbul-lib-source-maps@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.2.tgz#750578602435f28a0c04ee6d7d9e0f2960e62c1c" +istanbul-lib-source-maps@^1.2.1, istanbul-lib-source-maps@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.3.tgz#20fb54b14e14b3fb6edb6aca3571fd2143db44e6" dependencies: debug "^3.1.0" - istanbul-lib-coverage "^1.1.1" + istanbul-lib-coverage "^1.1.2" mkdirp "^0.5.1" rimraf "^2.6.1" source-map "^0.5.3" -istanbul-reports@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.3.tgz#3b9e1e8defb6d18b1d425da8e8b32c5a163f2d10" +istanbul-reports@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.4.tgz#5ccba5e22b7b5a5d91d5e0a830f89be334bf97bd" dependencies: handlebars "^4.0.3" -jest-changed-files@^22.1.4: - version "22.1.4" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-22.1.4.tgz#1f7844bcb739dec07e5899a633c0cb6d5069834e" +jest-changed-files@^22.2.0: + version "22.2.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-22.2.0.tgz#517610c4a8ca0925bdc88b0ca53bd678aa8d019e" dependencies: throat "^4.0.0" -jest-cli@^22.1.4: - version "22.1.4" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-22.1.4.tgz#0fe9f3ac881b0cdc00227114c58583a2ebefcc04" +jest-cli@^22.3.0: + version "22.3.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-22.3.0.tgz#3fd986f2674f4168c91965be56ab9917a82a45db" dependencies: ansi-escapes "^3.0.0" chalk "^2.0.1" @@ -1526,21 +1532,21 @@ jest-cli@^22.1.4: istanbul-lib-coverage "^1.1.1" istanbul-lib-instrument "^1.8.0" istanbul-lib-source-maps "^1.2.1" - jest-changed-files "^22.1.4" - jest-config "^22.1.4" - jest-environment-jsdom "^22.1.4" + jest-changed-files "^22.2.0" + jest-config "^22.3.0" + jest-environment-jsdom "^22.3.0" jest-get-type "^22.1.0" - jest-haste-map "^22.1.0" - jest-message-util "^22.1.0" + jest-haste-map "^22.3.0" + jest-message-util "^22.2.0" jest-regex-util "^22.1.0" jest-resolve-dependencies "^22.1.0" - jest-runner "^22.1.4" - jest-runtime "^22.1.4" - jest-snapshot "^22.1.2" - jest-util "^22.1.4" - jest-worker "^22.1.0" + jest-runner "^22.3.0" + jest-runtime "^22.3.0" + jest-snapshot "^22.2.0" + jest-util "^22.3.0" + jest-worker "^22.2.2" micromatch "^2.3.11" - node-notifier "^5.1.2" + node-notifier "^5.2.1" realpath-native "^1.0.0" rimraf "^2.5.4" slash "^1.0.0" @@ -1549,20 +1555,20 @@ jest-cli@^22.1.4: which "^1.2.12" yargs "^10.0.3" -jest-config@^22.1.4: - version "22.1.4" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-22.1.4.tgz#075ffacce83c3e38cf85b1b9ba0d21bd3ee27ad0" +jest-config@^22.3.0: + version "22.3.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-22.3.0.tgz#94c7149f123933a872ee24c1719687419c4a623c" dependencies: chalk "^2.0.1" glob "^7.1.1" - jest-environment-jsdom "^22.1.4" - jest-environment-node "^22.1.4" + jest-environment-jsdom "^22.3.0" + jest-environment-node "^22.3.0" jest-get-type "^22.1.0" - jest-jasmine2 "^22.1.4" + jest-jasmine2 "^22.3.0" jest-regex-util "^22.1.0" - jest-resolve "^22.1.4" - jest-util "^22.1.4" - jest-validate "^22.1.2" + jest-resolve "^22.3.0" + jest-util "^22.3.0" + jest-validate "^22.2.2" pretty-format "^22.1.0" jest-diff@^22.1.0: @@ -1574,56 +1580,56 @@ jest-diff@^22.1.0: jest-get-type "^22.1.0" pretty-format "^22.1.0" -jest-docblock@^22.1.0: - version "22.1.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-22.1.0.tgz#3fe5986d5444cbcb149746eb4b07c57c5a464dfd" +jest-docblock@^22.2.2: + version "22.2.2" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-22.2.2.tgz#617f13edb16ec64202002b3c336cd14ae36c0631" dependencies: detect-newline "^2.1.0" -jest-environment-jsdom@^22.1.4: - version "22.1.4" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-22.1.4.tgz#704518ce8375f7ec5de048d1e9c4268b08a03e00" +jest-environment-jsdom@^22.3.0: + version "22.3.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-22.3.0.tgz#c267a063e5dc16219fba0e07542d8aa2576a1c88" dependencies: - jest-mock "^22.1.0" - jest-util "^22.1.4" + jest-mock "^22.2.0" + jest-util "^22.3.0" jsdom "^11.5.1" -jest-environment-node@^22.1.4: - version "22.1.4" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-22.1.4.tgz#0f2946e8f8686ce6c5d8fa280ce1cd8d58e869eb" +jest-environment-node@^22.3.0: + version "22.3.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-22.3.0.tgz#97d34d9706a718d743075149d1950555c10338c0" dependencies: - jest-mock "^22.1.0" - jest-util "^22.1.4" + jest-mock "^22.2.0" + jest-util "^22.3.0" jest-get-type@^22.1.0: version "22.1.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.1.0.tgz#4e90af298ed6181edc85d2da500dbd2753e0d5a9" -jest-haste-map@^22.1.0: - version "22.1.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-22.1.0.tgz#1174c6ff393f9818ebf1163710d8868b5370da2a" +jest-haste-map@^22.3.0: + version "22.3.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-22.3.0.tgz#e7f048a88735bae07ca12de8785eb8bc522adeab" dependencies: fb-watchman "^2.0.0" graceful-fs "^4.1.11" - jest-docblock "^22.1.0" - jest-worker "^22.1.0" + jest-docblock "^22.2.2" + jest-worker "^22.2.2" micromatch "^2.3.11" sane "^2.0.0" -jest-jasmine2@^22.1.4: - version "22.1.4" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-22.1.4.tgz#cada0baf50a220c616a9575728b80d4ddedebe8b" +jest-jasmine2@^22.3.0: + version "22.3.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-22.3.0.tgz#ea127dfbb04c6e03998ae0358225435e47520666" dependencies: callsites "^2.0.0" chalk "^2.0.1" co "^4.6.0" - expect "^22.1.0" + expect "^22.3.0" graceful-fs "^4.1.11" is-generator-fn "^1.0.0" jest-diff "^22.1.0" - jest-matcher-utils "^22.1.0" - jest-message-util "^22.1.0" - jest-snapshot "^22.1.2" + jest-matcher-utils "^22.2.0" + jest-message-util "^22.2.0" + jest-snapshot "^22.2.0" source-map-support "^0.5.0" jest-leak-detector@^22.1.0: @@ -1632,17 +1638,17 @@ jest-leak-detector@^22.1.0: dependencies: pretty-format "^22.1.0" -jest-matcher-utils@^22.1.0: - version "22.1.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-22.1.0.tgz#e164665b5d313636ac29f7f6fe9ef0a6ce04febc" +jest-matcher-utils@^22.2.0: + version "22.2.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-22.2.0.tgz#5390f823c18c748543d463825aa8e4df0db253ca" dependencies: chalk "^2.0.1" jest-get-type "^22.1.0" pretty-format "^22.1.0" -jest-message-util@^22.1.0: - version "22.1.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-22.1.0.tgz#51ba0794cb6e579bfc4e9adfac452f9f1a0293fc" +jest-message-util@^22.2.0: + version "22.2.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-22.2.0.tgz#84a6bb34186d8b9af7e0732fabbef63f7355f7b2" dependencies: "@babel/code-frame" "^7.0.0-beta.35" chalk "^2.0.1" @@ -1650,9 +1656,9 @@ jest-message-util@^22.1.0: slash "^1.0.0" stack-utils "^1.0.1" -jest-mock@^22.1.0: - version "22.1.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-22.1.0.tgz#87ec21c0599325671c9a23ad0e05c86fb5879b61" +jest-mock@^22.2.0: + version "22.2.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-22.2.0.tgz#444b3f9488a7473adae09bc8a77294afded397a7" jest-regex-util@^22.1.0: version "22.1.0" @@ -1664,45 +1670,45 @@ jest-resolve-dependencies@^22.1.0: dependencies: jest-regex-util "^22.1.0" -jest-resolve@^22.1.4: - version "22.1.4" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-22.1.4.tgz#72b9b371eaac48f84aad4ad732222ffe37692602" +jest-resolve@^22.3.0: + version "22.3.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-22.3.0.tgz#648e797f708e8701071a0fa9fac652c577bb66d9" dependencies: browser-resolve "^1.11.2" chalk "^2.0.1" -jest-runner@^22.1.4: - version "22.1.4" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-22.1.4.tgz#e039039110cb1b31febc0f99e349bf7c94304a2f" +jest-runner@^22.3.0: + version "22.3.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-22.3.0.tgz#70393f62770be754e2d14f5ca3d896e408aa001a" dependencies: exit "^0.1.2" - jest-config "^22.1.4" - jest-docblock "^22.1.0" - jest-haste-map "^22.1.0" - jest-jasmine2 "^22.1.4" + jest-config "^22.3.0" + jest-docblock "^22.2.2" + jest-haste-map "^22.3.0" + jest-jasmine2 "^22.3.0" jest-leak-detector "^22.1.0" - jest-message-util "^22.1.0" - jest-runtime "^22.1.4" - jest-util "^22.1.4" - jest-worker "^22.1.0" + jest-message-util "^22.2.0" + jest-runtime "^22.3.0" + jest-util "^22.3.0" + jest-worker "^22.2.2" throat "^4.0.0" -jest-runtime@^22.1.4: - version "22.1.4" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-22.1.4.tgz#1474d9f5cda518b702e0b25a17d4ef3fc563a20c" +jest-runtime@^22.3.0: + version "22.3.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-22.3.0.tgz#1883d6a4227c1f6af276ead3ed27654257d1ef8c" dependencies: babel-core "^6.0.0" - babel-jest "^22.1.0" + babel-jest "^22.2.2" babel-plugin-istanbul "^4.1.5" chalk "^2.0.1" convert-source-map "^1.4.0" exit "^0.1.2" graceful-fs "^4.1.11" - jest-config "^22.1.4" - jest-haste-map "^22.1.0" + jest-config "^22.3.0" + jest-haste-map "^22.3.0" jest-regex-util "^22.1.0" - jest-resolve "^22.1.4" - jest-util "^22.1.4" + jest-resolve "^22.3.0" + jest-util "^22.3.0" json-stable-stringify "^1.0.1" micromatch "^2.3.11" realpath-native "^1.0.0" @@ -1711,49 +1717,50 @@ jest-runtime@^22.1.4: write-file-atomic "^2.1.0" yargs "^10.0.3" -jest-snapshot@^22.1.2: - version "22.1.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-22.1.2.tgz#b270cf6e3098f33aceeafda02b13eb0933dc6139" +jest-snapshot@^22.2.0: + version "22.2.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-22.2.0.tgz#0c0ba152d296ef70fa198cc84977a2cc269ee4cf" dependencies: chalk "^2.0.1" jest-diff "^22.1.0" - jest-matcher-utils "^22.1.0" + jest-matcher-utils "^22.2.0" mkdirp "^0.5.1" natural-compare "^1.4.0" pretty-format "^22.1.0" -jest-util@^22.1.4: - version "22.1.4" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-22.1.4.tgz#ac8cbd43ee654102f1941f3f0e9d1d789a8b6a9b" +jest-util@^22.3.0: + version "22.3.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-22.3.0.tgz#d05bff567a3a86c0e9b3838d812f8290aa768097" dependencies: callsites "^2.0.0" chalk "^2.0.1" graceful-fs "^4.1.11" is-ci "^1.0.10" - jest-message-util "^22.1.0" - jest-validate "^22.1.2" + jest-message-util "^22.2.0" + jest-validate "^22.2.2" mkdirp "^0.5.1" -jest-validate@^22.1.2: - version "22.1.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-22.1.2.tgz#c3b06bcba7bd9a850919fe336b5f2a8c3a239404" +jest-validate@^22.2.2: + version "22.2.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-22.2.2.tgz#9cdce422c93cc28395e907ac6bbc929158d9a6ba" dependencies: chalk "^2.0.1" jest-get-type "^22.1.0" leven "^2.1.0" pretty-format "^22.1.0" -jest-worker@^22.1.0: - version "22.1.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-22.1.0.tgz#0987832fe58fbdc205357f4c19b992446368cafb" +jest-worker@^22.2.2: + version "22.2.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-22.2.2.tgz#c1f5dc39976884b81f68ec50cb8532b2cbab3390" dependencies: merge-stream "^1.0.1" -jest@^22.1.4: - version "22.1.4" - resolved "https://registry.yarnpkg.com/jest/-/jest-22.1.4.tgz#9ec71373a38f40ff92a3e5e96ae85687c181bb72" +jest@^22.3.0: + version "22.3.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-22.3.0.tgz#07434314d2e8662ea936552d950680b7e6551b0d" dependencies: - jest-cli "^22.1.4" + import-local "^1.0.0" + jest-cli "^22.3.0" js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" @@ -1771,8 +1778,8 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" jsdom@^11.5.1: - version "11.6.1" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.6.1.tgz#43fffc10072597a8ee9680cba46900d9e4dbeba2" + version "11.6.2" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.6.2.tgz#25d1ef332d48adf77fc5221fe2619967923f16bb" dependencies: abab "^1.0.4" acorn "^5.3.0" @@ -1787,7 +1794,7 @@ jsdom@^11.5.1: html-encoding-sniffer "^1.0.2" left-pad "^1.2.0" nwmatcher "^1.4.3" - parse5 "^4.0.0" + parse5 "4.0.0" pn "^1.1.0" request "^2.83.0" request-promise-native "^1.0.5" @@ -1903,8 +1910,8 @@ lodash.sortby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" lodash@^4.13.1, lodash@^4.14.0, lodash@^4.17.4, lodash@^4.3.0: - version "4.17.4" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + version "4.17.5" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" longest@^1.0.1: version "1.0.1" @@ -1963,19 +1970,19 @@ micromatch@^2.1.5, micromatch@^2.3.11: parse-glob "^3.0.4" regex-cache "^0.4.2" -mime-db@~1.30.0: - version "1.30.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01" +mime-db@~1.33.0: + version "1.33.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.7: - version "2.1.17" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a" + version "2.1.18" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" dependencies: - mime-db "~1.30.0" + mime-db "~1.33.0" mimic-fn@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" @@ -2021,7 +2028,7 @@ node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" -node-notifier@^5.1.2: +node-notifier@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.2.1.tgz#fa313dd08f5517db0e2502e5758d664ac69f9dea" dependencies: @@ -2164,8 +2171,8 @@ os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" osenv@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.0" @@ -2205,7 +2212,7 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" -parse5@^4.0.0: +parse5@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" @@ -2298,9 +2305,9 @@ private@^0.1.7: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" progress@^2.0.0: version "2.0.0" @@ -2334,8 +2341,8 @@ randomatic@^1.1.3: kind-of "^4.0.0" rc@^1.1.7: - version "1.2.4" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.4.tgz#a0f606caae2a3b862bbd0ef85482c0125b315fa3" + version "1.2.5" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.5.tgz#275cd687f6e3b36cc756baa26dfee80a790301fd" dependencies: deep-extend "~0.4.0" ini "~1.3.0" @@ -2358,13 +2365,13 @@ read-pkg@^1.0.0: path-type "^1.0.0" readable-stream@^2.0.1, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.2.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" + version "2.3.4" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.4.tgz#c946c3f47fa7d8eabc0b6150f4a12f69a4574071" dependencies: core-util-is "~1.0.0" inherits "~2.0.3" isarray "~1.0.0" - process-nextick-args "~1.0.6" + process-nextick-args "~2.0.0" safe-buffer "~5.1.1" string_decoder "~1.0.3" util-deprecate "~1.0.1" @@ -2544,8 +2551,8 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" sane@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-2.3.0.tgz#3f3df584abf69e63d4bb74f0f8c42468e4d7d46b" + version "2.4.1" + resolved "https://registry.yarnpkg.com/sane/-/sane-2.4.1.tgz#29f991208cf28636720efdc584293e7fd66663a5" dependencies: anymatch "^1.3.0" exec-sh "^0.2.0" @@ -2627,7 +2634,7 @@ source-map@^0.4.4: dependencies: amdefine ">=0.0.4" -source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.6: +source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1, source-map@~0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -2747,11 +2754,11 @@ supports-color@^3.1.2: dependencies: has-flag "^1.0.0" -supports-color@^4.0.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" +supports-color@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.2.0.tgz#b0d5333b1184dd3666cbe5aa0b45c5ac7ac17a4a" dependencies: - has-flag "^2.0.0" + has-flag "^3.0.0" symbol-tree@^3.2.2: version "3.2.2" @@ -2790,8 +2797,8 @@ tar@^2.2.1: inherits "2" test-exclude@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" + version "4.2.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.0.tgz#07e3613609a362c74516a717515e13322ab45b3c" dependencies: arrify "^1.0.1" micromatch "^2.3.11" From d17615b9f4ea62c94dd53820e640bd489aa32cbf Mon Sep 17 00:00:00 2001 From: svipben Date: Sat, 17 Feb 2018 16:41:20 +0200 Subject: [PATCH 03/10] Improved Travis CI to run ESLint before tests --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 57f9ecf..2f242a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,3 +2,6 @@ language: node_js node_js: - "node" - "lts/*" +script: + - "yarn run lint" + - "yarn test" From e92c58f98e490a5999c4d6185980617f756423de Mon Sep 17 00:00:00 2001 From: svipben Date: Sat, 17 Feb 2018 16:41:45 +0200 Subject: [PATCH 04/10] Improved README to show example of improved `clear()` function --- README.md | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b16c572..b17d780 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ yarn add cachimo # How to use +### `put` function + ```js const cachimo = require('cachimo'); @@ -59,6 +61,31 @@ cachimo.put('key', 'value', 1000, (err, key, value, timeout) => { }); ``` +### `clear` function + +```js +const cachimo = require('cachimo'); + +// Promise +cachimo.put('key', 'value', 1000).catch(err => { + // you will get error because at the end of the code there's `clear()` function which clears all timeouts as well as keys and values + throw err; // "key timeout was cleared" +}); + +// callback +cachimo.put('key', 'value', 1000, err => { + if (err) { + // you will get error because at the end of the code there's `clear()` function which clears all timeouts as well as keys and values + throw err; // "key timeout was cleared" + } +}); + +// removes all elements stored in cache and clears all timeouts +cachimo.clear(); // returns number of how much elements was removed from cache +``` + +### Other functions + ```js const cachimo = require('cachimo'); @@ -82,7 +109,4 @@ cachimo.values(); // ['value'] // returns all entries (keys and values) stored in cache cachimo.entries(); // [['key', 'value']] - -// removes all elements stored in cache and clears all timeouts -cachimo.clear(); // returns number of how much elements was removed from cache ``` From 46c990609252981f0918571a76c920c1ba50c5ce Mon Sep 17 00:00:00 2001 From: svipben Date: Sat, 17 Feb 2018 16:48:58 +0200 Subject: [PATCH 05/10] Added comment to explain why `callback()` is executed --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index c0620c0..bff512b 100644 --- a/index.js +++ b/index.js @@ -78,6 +78,8 @@ function entries() { function clear() { timeouts.forEach((callback, timeout) => { clearTimeout(timeout); + + // reject Promise or execute callback which returns Error callback(); }); From d19d17151640b45e72f3089c7096d70f192e5228 Mon Sep 17 00:00:00 2001 From: svipben Date: Sat, 17 Feb 2018 17:01:19 +0200 Subject: [PATCH 06/10] Improved tests to be more isolated --- CHANGELOG.md | 1 + tests/callback.test.js | 32 +++++++++++ tests/common-checks.test.js | 25 ++++++++ tests/errors.test.js | 12 ++++ tests/index.test.js | 111 ------------------------------------ tests/promise.test.js | 33 +++++++++++ tests/timeouts.test.js | 19 ++++++ 7 files changed, 122 insertions(+), 111 deletions(-) create mode 100644 tests/callback.test.js create mode 100644 tests/common-checks.test.js create mode 100644 tests/errors.test.js delete mode 100644 tests/index.test.js create mode 100644 tests/promise.test.js create mode 100644 tests/timeouts.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index d92335e..51a37c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * `clear()` function to also reject Promise or execute callback to inform if timeout was cleared. * `README.md` to show how new `clear()` function works. * Travis CI to also run ESLint before tests. +* Tests to be more isolated. ### Updated diff --git a/tests/callback.test.js b/tests/callback.test.js new file mode 100644 index 0000000..90894c0 --- /dev/null +++ b/tests/callback.test.js @@ -0,0 +1,32 @@ +const cachimo = require('../index'); + +test('callback', done => { + expect( + cachimo.put('key', 'value', 1000, (err, key, value, timeout) => { + expect(err).toBe(null); + expect(key).toBe('key'); + expect(value).toBe('value'); + expect(timeout).toBe(1000); + + expect(cachimo.has('key')).toBeFalsy(); + expect(cachimo.get('key')).toBe(undefined); + expect(cachimo.size()).toBe(0); + + done(); + }) + ).toBeTruthy(); + + expect(cachimo.put('key', 'value')).toBeFalsy(); + expect(cachimo.has('key')).toBeTruthy(); + expect(cachimo.get('key')).toBe('value'); + expect(cachimo.size()).toBe(1); +}); + +test('element remove before timeout', done => { + cachimo.put('key', 'value', 500, err => { + expect(err).toBeInstanceOf(Error); + expect(err.message).toBe('key does not exist'); + done(); + }); + cachimo.remove('key'); +}); diff --git a/tests/common-checks.test.js b/tests/common-checks.test.js new file mode 100644 index 0000000..97e9f6c --- /dev/null +++ b/tests/common-checks.test.js @@ -0,0 +1,25 @@ +const cachimo = require('../index'); + +test('common checks', () => { + expect(cachimo.put('key', 'value')).toBeTruthy(); + expect(cachimo.put('key', 'value')).toBeFalsy(); + + expect(cachimo.has('key')).toBeTruthy(); + expect(cachimo.has('unknown')).toBeFalsy(); + + expect(cachimo.size()).toBe(1); + + expect(cachimo.get('key')).toBe('value'); + expect(cachimo.get('unknown')).toBe(undefined); + + expect(cachimo.keys()).toEqual(['key']); + expect(cachimo.values()).toEqual(['value']); + expect(cachimo.entries()).toEqual([['key', 'value']]); + + expect(cachimo.remove('key')).toBeTruthy(); + expect(cachimo.remove('key')).toBeFalsy(); + + expect(cachimo.clear()).toBe(0); + cachimo.put('key', 'value'); + expect(cachimo.clear()).toBe(1); +}); diff --git a/tests/errors.test.js b/tests/errors.test.js new file mode 100644 index 0000000..13338fb --- /dev/null +++ b/tests/errors.test.js @@ -0,0 +1,12 @@ +const cachimo = require('../index'); + +test('errors', () => { + expect(() => cachimo.put(null)).toThrowError(); + expect(() => cachimo.put(undefined)).toThrowError(); + expect(() => cachimo.put(NaN)).toThrowError(); + expect(() => cachimo.put({})).toThrowError(); + expect(() => cachimo.put(() => {})).toThrowError(); + expect(() => cachimo.put('key', 'value', '1')).toThrowError(); + expect(() => cachimo.put('key', 'value', -1)).toThrowError(); + expect(() => cachimo.put('key', 'value', 1, 'function')).toThrowError(); +}); diff --git a/tests/index.test.js b/tests/index.test.js deleted file mode 100644 index 07aa89c..0000000 --- a/tests/index.test.js +++ /dev/null @@ -1,111 +0,0 @@ -const cachimo = require('../index'); - -test('errors', () => { - expect(() => cachimo.put(null)).toThrowError(); - expect(() => cachimo.put(undefined)).toThrowError(); - expect(() => cachimo.put(NaN)).toThrowError(); - expect(() => cachimo.put({})).toThrowError(); - expect(() => cachimo.put(() => {})).toThrowError(); - expect(() => cachimo.put('key', 'value', '1')).toThrowError(); - expect(() => cachimo.put('key', 'value', -1)).toThrowError(); - expect(() => cachimo.put('key', 'value', 1, 'function')).toThrowError(); -}); - -test('common checks', () => { - expect(cachimo.put('key', 'value')).toBeTruthy(); - expect(cachimo.put('key', 'value')).toBeFalsy(); - - expect(cachimo.has('key')).toBeTruthy(); - expect(cachimo.has('unknown')).toBeFalsy(); - - expect(cachimo.size()).toBe(1); - - expect(cachimo.get('key')).toBe('value'); - expect(cachimo.get('unknown')).toBe(undefined); - - expect(cachimo.keys()).toEqual(['key']); - expect(cachimo.values()).toEqual(['value']); - expect(cachimo.entries()).toEqual([['key', 'value']]); - - expect(cachimo.remove('key')).toBeTruthy(); - expect(cachimo.remove('key')).toBeFalsy(); - - expect(cachimo.clear()).toBe(0); - cachimo.put('key', 'value'); - expect(cachimo.clear()).toBe(1); -}); - -test('promise', async () => { - try { - const promise = cachimo.put('key', 'value', 1000); - expect(promise.constructor).toBe(Promise); - - expect(cachimo.put('key', 'value')).toBeFalsy(); - expect(cachimo.has('key')).toBeTruthy(); - expect(cachimo.get('key')).toBe('value'); - expect(cachimo.size()).toBe(1); - - const { key, value, timeout } = await promise; - expect(key).toBe('key'); - expect(value).toBe('value'); - expect(timeout).toBe(1000); - - expect(cachimo.has('key')).toBeFalsy(); - expect(cachimo.get('key')).toBe(undefined); - expect(cachimo.size()).toBe(0); - } catch (err) { - throw err; - } -}); - -test('callback', done => { - expect( - cachimo.put('key', 'value', 1000, (err, key, value, timeout) => { - expect(err).toBe(null); - expect(key).toBe('key'); - expect(value).toBe('value'); - expect(timeout).toBe(1000); - - expect(cachimo.has('key')).toBeFalsy(); - expect(cachimo.get('key')).toBe(undefined); - expect(cachimo.size()).toBe(0); - - done(); - }) - ).toBeTruthy(); - - expect(cachimo.put('key', 'value')).toBeFalsy(); - expect(cachimo.has('key')).toBeTruthy(); - expect(cachimo.get('key')).toBe('value'); - expect(cachimo.size()).toBe(1); -}); - -test('element remove before timeout', done => { - cachimo.put('key', 'value', 500, err => { - expect(err).toBeInstanceOf(Error); - expect(err.message).toBe('key does not exist'); - done(); - }); - cachimo.remove('key'); - - const promise = cachimo.put('key', 'value', 1000); - cachimo.remove('key'); - promise.catch(err => { - expect(err).toBeInstanceOf(Error); - expect(err.message).toBe('key does not exist'); - }); -}); - -test('clear all timeouts', () => { - cachimo.put('promiseKey', 'promiseValue', 1000).catch(err => { - expect(err).toBeInstanceOf(Error); - expect(err.message).toBe('promiseKey timeout was cleared'); - }); - - cachimo.put('cbKey', 'cbValue', 2000, err => { - expect(err).toBeInstanceOf(Error); - expect(err.message).toBe('cbKey timeout was cleared'); - }); - - cachimo.clear(); -}); diff --git a/tests/promise.test.js b/tests/promise.test.js new file mode 100644 index 0000000..de4364f --- /dev/null +++ b/tests/promise.test.js @@ -0,0 +1,33 @@ +const cachimo = require('../index'); + +test('promise', async () => { + try { + const promise = cachimo.put('key', 'value', 1000); + expect(promise.constructor).toBe(Promise); + + expect(cachimo.put('key', 'value')).toBeFalsy(); + expect(cachimo.has('key')).toBeTruthy(); + expect(cachimo.get('key')).toBe('value'); + expect(cachimo.size()).toBe(1); + + const { key, value, timeout } = await promise; + expect(key).toBe('key'); + expect(value).toBe('value'); + expect(timeout).toBe(1000); + + expect(cachimo.has('key')).toBeFalsy(); + expect(cachimo.get('key')).toBe(undefined); + expect(cachimo.size()).toBe(0); + } catch (err) { + throw err; + } +}); + +test('element remove before timeout', () => { + const promise = cachimo.put('key', 'value', 1000); + cachimo.remove('key'); + promise.catch(err => { + expect(err).toBeInstanceOf(Error); + expect(err.message).toBe('key does not exist'); + }); +}); diff --git a/tests/timeouts.test.js b/tests/timeouts.test.js new file mode 100644 index 0000000..af5b561 --- /dev/null +++ b/tests/timeouts.test.js @@ -0,0 +1,19 @@ +const cachimo = require('../index'); + +test('clear all timeouts (callback)', () => { + cachimo.put('key', 'value', 1000, err => { + expect(err).toBeInstanceOf(Error); + expect(err.message).toBe('key timeout was cleared'); + }); + + cachimo.clear(); +}); + +test('clear all timeouts (promise)', () => { + cachimo.put('key', 'value', 1000).catch(err => { + expect(err).toBeInstanceOf(Error); + expect(err.message).toBe('key timeout was cleared'); + }); + + cachimo.clear(); +}); From 612ad4cf0fcda4586ff71df4dd48369e13c9b000 Mon Sep 17 00:00:00 2001 From: svipben Date: Sat, 17 Feb 2018 17:43:18 +0200 Subject: [PATCH 07/10] Moved all `index.js` code to the `src/cachimo.js` --- index.js | 168 +----------------------------------- src/cachimo.js | 167 +++++++++++++++++++++++++++++++++++ tests/callback.test.js | 2 +- tests/common-checks.test.js | 2 +- tests/errors.test.js | 2 +- tests/promise.test.js | 2 +- tests/timeouts.test.js | 2 +- 7 files changed, 173 insertions(+), 172 deletions(-) create mode 100644 src/cachimo.js diff --git a/index.js b/index.js index bff512b..a39f793 100644 --- a/index.js +++ b/index.js @@ -1,167 +1 @@ -const cache = new Map(); -const timeouts = new Map(); - -/** - * Returns value from cache by given `key`. - * - * @param {string | number | boolean} key - * - * @returns {any} value from cache - */ -function get(key) { - return cache.get(key); -} - -/** - * Removes element from cache by given `key`. - * - * @param {string | number | boolean} key - * - * @returns {boolean} true if element has been removed, false otherwise - */ -function remove(key) { - return cache.delete(key); -} - -/** - * Checks if whether an element with given `key` exist. - * - * @param {string | number | boolean} key - * - * @returns {boolean} true if element exist, false otherwise - */ -function has(key) { - return cache.has(key); -} - -/** - * Returns the number of elements in cache. - * - * @returns {number} number of elements in cache - */ -function size() { - return cache.size; -} - -/** - * Returns all keys stored in cache. - * - * @returns {Array} all keys - */ -function keys() { - return [...cache.keys()]; -} - -/** - * Returns all values stored in cache. - * - * @returns {Array} all values - */ -function values() { - return [...cache.values()]; -} - -/** - * Returns all entries (keys and values) stored in cache. - * - * @returns {Array<[string | number | boolean, any]>} all entries (keys and values) - */ -function entries() { - return [...cache.entries()]; -} - -/** - * Removes all elements stored in cache and clears all timeouts. - * - * @returns {number} how much elements was removed from cache - */ -function clear() { - timeouts.forEach((callback, timeout) => { - clearTimeout(timeout); - - // reject Promise or execute callback which returns Error - callback(); - }); - - const length = size(); - cache.clear(); - return length; -} - -/** - * Stores an element in-memory with specified key and value. - * - * If only `key` and `value` is provided it returns boolean. - * true: if element was stored and key doesn't exist. - * false: if key does exist. - * - * If additionally only `timeout` is provided it returns Promise. - * Element will be deleted after given `timeout` and Promise will be resolved. - * Otherwise it will be rejected if element does not exist. - * - * If additionally `timeout` and `callback` is provided it executes given `callback` after given `timeout`. - * - * @param {string | number | boolean} key can be only: `string` | `number` | `boolean` - * @param {any} value can be any type - * @param {number} timeout after how much time in milliseconds element will be deleted - * @param {(err: Error, key: string | number | boolean, value: any, timeout: number)} callback will be executed after given `timeout` - * - * @returns {boolean | Promise<{ key: string | number | boolean, value: any, timeout: number }>} boolean or Promise - */ -function put(key, value, timeout, callback) { - // key type is incorrect - if (typeof key !== 'string' && typeof key !== 'number' && typeof key !== 'boolean') { - throw new TypeError(`key can be only: string | number | boolean instead of ${typeof key}`); - } - // check if key is not NaN - if (typeof key === 'number' && isNaN(key)) { - throw new TypeError('key can be only: string | number | boolean instead of NaN'); - } - - // timeout type is incorrect and/or timeout is not positive number - if (timeout !== undefined && (typeof timeout !== 'number' || isNaN(timeout) || timeout <= 0)) { - throw new TypeError('timeout should be positive number'); - } - - // callback type is incorrect - if (callback !== undefined && typeof callback !== 'function') { - throw new TypeError(`callback should be function instead of ${typeof callback}`); - } - - // key does exist - if (has(key)) { - return false; - } - - cache.set(key, value); - - // return Promise - if (timeout !== undefined && callback === undefined) { - return new Promise((resolve, reject) => { - const t = setTimeout(() => { - if (cache.delete(key)) { - resolve({ key, value, timeout }); - } else { - reject(new Error(`${key} does not exist`)); - } - }, timeout); - timeouts.set(t, () => reject(new Error(`${key} timeout was cleared`))); - }); - } - - // execute callback - if (timeout !== undefined && callback !== undefined) { - const t = setTimeout(() => { - if (cache.delete(key)) { - callback(null, key, value, timeout); - } else { - callback(new Error(`${key} does not exist`)); - } - }, timeout); - timeouts.set(t, () => callback(new Error(`${key} timeout was cleared`))); - } - - return true; -} - -module.exports = { get, remove, has, size, keys, values, entries, clear, put }; +module.exports = require('./src/cachimo'); diff --git a/src/cachimo.js b/src/cachimo.js new file mode 100644 index 0000000..bff512b --- /dev/null +++ b/src/cachimo.js @@ -0,0 +1,167 @@ +const cache = new Map(); +const timeouts = new Map(); + +/** + * Returns value from cache by given `key`. + * + * @param {string | number | boolean} key + * + * @returns {any} value from cache + */ +function get(key) { + return cache.get(key); +} + +/** + * Removes element from cache by given `key`. + * + * @param {string | number | boolean} key + * + * @returns {boolean} true if element has been removed, false otherwise + */ +function remove(key) { + return cache.delete(key); +} + +/** + * Checks if whether an element with given `key` exist. + * + * @param {string | number | boolean} key + * + * @returns {boolean} true if element exist, false otherwise + */ +function has(key) { + return cache.has(key); +} + +/** + * Returns the number of elements in cache. + * + * @returns {number} number of elements in cache + */ +function size() { + return cache.size; +} + +/** + * Returns all keys stored in cache. + * + * @returns {Array} all keys + */ +function keys() { + return [...cache.keys()]; +} + +/** + * Returns all values stored in cache. + * + * @returns {Array} all values + */ +function values() { + return [...cache.values()]; +} + +/** + * Returns all entries (keys and values) stored in cache. + * + * @returns {Array<[string | number | boolean, any]>} all entries (keys and values) + */ +function entries() { + return [...cache.entries()]; +} + +/** + * Removes all elements stored in cache and clears all timeouts. + * + * @returns {number} how much elements was removed from cache + */ +function clear() { + timeouts.forEach((callback, timeout) => { + clearTimeout(timeout); + + // reject Promise or execute callback which returns Error + callback(); + }); + + const length = size(); + cache.clear(); + return length; +} + +/** + * Stores an element in-memory with specified key and value. + * + * If only `key` and `value` is provided it returns boolean. + * true: if element was stored and key doesn't exist. + * false: if key does exist. + * + * If additionally only `timeout` is provided it returns Promise. + * Element will be deleted after given `timeout` and Promise will be resolved. + * Otherwise it will be rejected if element does not exist. + * + * If additionally `timeout` and `callback` is provided it executes given `callback` after given `timeout`. + * + * @param {string | number | boolean} key can be only: `string` | `number` | `boolean` + * @param {any} value can be any type + * @param {number} timeout after how much time in milliseconds element will be deleted + * @param {(err: Error, key: string | number | boolean, value: any, timeout: number)} callback will be executed after given `timeout` + * + * @returns {boolean | Promise<{ key: string | number | boolean, value: any, timeout: number }>} boolean or Promise + */ +function put(key, value, timeout, callback) { + // key type is incorrect + if (typeof key !== 'string' && typeof key !== 'number' && typeof key !== 'boolean') { + throw new TypeError(`key can be only: string | number | boolean instead of ${typeof key}`); + } + // check if key is not NaN + if (typeof key === 'number' && isNaN(key)) { + throw new TypeError('key can be only: string | number | boolean instead of NaN'); + } + + // timeout type is incorrect and/or timeout is not positive number + if (timeout !== undefined && (typeof timeout !== 'number' || isNaN(timeout) || timeout <= 0)) { + throw new TypeError('timeout should be positive number'); + } + + // callback type is incorrect + if (callback !== undefined && typeof callback !== 'function') { + throw new TypeError(`callback should be function instead of ${typeof callback}`); + } + + // key does exist + if (has(key)) { + return false; + } + + cache.set(key, value); + + // return Promise + if (timeout !== undefined && callback === undefined) { + return new Promise((resolve, reject) => { + const t = setTimeout(() => { + if (cache.delete(key)) { + resolve({ key, value, timeout }); + } else { + reject(new Error(`${key} does not exist`)); + } + }, timeout); + timeouts.set(t, () => reject(new Error(`${key} timeout was cleared`))); + }); + } + + // execute callback + if (timeout !== undefined && callback !== undefined) { + const t = setTimeout(() => { + if (cache.delete(key)) { + callback(null, key, value, timeout); + } else { + callback(new Error(`${key} does not exist`)); + } + }, timeout); + timeouts.set(t, () => callback(new Error(`${key} timeout was cleared`))); + } + + return true; +} + +module.exports = { get, remove, has, size, keys, values, entries, clear, put }; diff --git a/tests/callback.test.js b/tests/callback.test.js index 90894c0..7d280f0 100644 --- a/tests/callback.test.js +++ b/tests/callback.test.js @@ -1,4 +1,4 @@ -const cachimo = require('../index'); +const cachimo = require('../src/cachimo'); test('callback', done => { expect( diff --git a/tests/common-checks.test.js b/tests/common-checks.test.js index 97e9f6c..1ee6567 100644 --- a/tests/common-checks.test.js +++ b/tests/common-checks.test.js @@ -1,4 +1,4 @@ -const cachimo = require('../index'); +const cachimo = require('../src/cachimo'); test('common checks', () => { expect(cachimo.put('key', 'value')).toBeTruthy(); diff --git a/tests/errors.test.js b/tests/errors.test.js index 13338fb..03ef625 100644 --- a/tests/errors.test.js +++ b/tests/errors.test.js @@ -1,4 +1,4 @@ -const cachimo = require('../index'); +const cachimo = require('../src/cachimo'); test('errors', () => { expect(() => cachimo.put(null)).toThrowError(); diff --git a/tests/promise.test.js b/tests/promise.test.js index de4364f..9018d43 100644 --- a/tests/promise.test.js +++ b/tests/promise.test.js @@ -1,4 +1,4 @@ -const cachimo = require('../index'); +const cachimo = require('../src/cachimo'); test('promise', async () => { try { diff --git a/tests/timeouts.test.js b/tests/timeouts.test.js index af5b561..2823f7e 100644 --- a/tests/timeouts.test.js +++ b/tests/timeouts.test.js @@ -1,4 +1,4 @@ -const cachimo = require('../index'); +const cachimo = require('../src/cachimo'); test('clear all timeouts (callback)', () => { cachimo.put('key', 'value', 1000, err => { From c5074080390906f0d6c3988a14a7a4d2c98c5eca Mon Sep 17 00:00:00 2001 From: svipben Date: Sat, 17 Feb 2018 17:43:33 +0200 Subject: [PATCH 08/10] Added typings prop in `package.json` --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 797ca24..1821b47 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "description": "Stores key with value in-memory and can be deleted manually or after given timeout.", "version": "1.0.4", "main": "index.js", + "typings": "index.d.ts", "repository": "https://github.com/svipben/cachimo.git", "author": "svipben ", "license": "MIT", From 9b13551499ed6ed3cda975b35640f717458e0c5f Mon Sep 17 00:00:00 2001 From: svipben Date: Sat, 17 Feb 2018 17:43:38 +0200 Subject: [PATCH 09/10] Updated CHANGELOG --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51a37c4..7f48c8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,16 @@ ## [1.0.4](https://github.com/svipben/cachimo/releases/tag/1.0.4) (2018-02-17) -### Improved +### Added + +* `typings` property in `package.json`. + +### Changed * `clear()` function to also reject Promise or execute callback to inform if timeout was cleared. * `README.md` to show how new `clear()` function works. * Travis CI to also run ESLint before tests. * Tests to be more isolated. +* Moved all `index.js` code to the `src/cachimo.js`. ### Updated From 2b135c628f9d3c31bfd8b8a0c1094510dc630957 Mon Sep 17 00:00:00 2001 From: svipben Date: Sat, 17 Feb 2018 17:54:37 +0200 Subject: [PATCH 10/10] Disable Travis CI email notifications --- .travis.yml | 2 ++ CHANGELOG.md | 1 + 2 files changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2f242a3..6c27f2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,3 +5,5 @@ node_js: script: - "yarn run lint" - "yarn test" +notifications: + email: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f48c8e..cca6b5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * `clear()` function to also reject Promise or execute callback to inform if timeout was cleared. * `README.md` to show how new `clear()` function works. * Travis CI to also run ESLint before tests. +* Travis CI to disable email notifications. * Tests to be more isolated. * Moved all `index.js` code to the `src/cachimo.js`.