Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update unit tests #526

Merged
merged 5 commits into from Apr 14, 2020
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Next

update jest config and remove old dependencies

  • Loading branch information
christophertino committed Apr 9, 2020
commit 75dc1d699b065d419ef3411e51de376cb8856a5a
@@ -12,4 +12,4 @@ install:
script:
- node ./tools/licenses/fetchLicenses.js
- yarn lint
- yarn test.unit
- yarn test
@@ -31,7 +31,7 @@ You can also submit feature requests to the [issue tracker](../../issues). Befor
+ Make your pull request from "develop" in your fork to "develop" in the source
+ Use short, meaningful commit messages
+ Lint your code before committing and making a pull request (`npm run lint`)
+ Write unit tests for new features and make sure all tests are passing (`npm run test.unit`)
+ Write unit tests for new features and make sure all tests are passing (`npm run test`)
+ If your pull request has multiple commits or commits that are not meaningful, consider [squashing](https://git-scm.com/docs/git-rebase#_interactive_mode) them

#### Submitting Patches via Email
@@ -62,7 +62,7 @@ $ yarn test.snapshot

```sh
# Run unit tests
$ yarn test.unit
$ yarn test
```

```sh
@@ -16,5 +16,9 @@ module.exports = {
setupFiles: [
'./test/setup.js'
],
testURL: 'http://localhost'
roots: [
'<rootDir>/src/',
'<rootDir>/app/'
],
testURL: 'http://localhost',
};
@@ -16,7 +16,8 @@
"prebuild.dev": "node ./tools/licenses/fetchLicenses.js",
"prebuild.prod": "node ./tools/licenses/fetchLicenses.js",
"prebuild.watch": "node ./tools/licenses/fetchLicenses.js",
"test.unit": "cross-env BABEL_ENV=test jest",
"test": "cross-env BABEL_ENV=test jest",
"test.watch": "cross-env BABEL_ENV=test jest --watch",
"test.snapshot": "jest --updateSnapshot",
"lint": "eslint --ext .js,.jsx ./app ./src",
"lint.fix": "eslint --ext .js,.jsx ./app ./src --fix",
@@ -66,8 +67,7 @@
"rsvp": "^4.8.5",
"spanan": "^2.0.0",
"ua-parser-js": "^0.7.21",
"underscore": "^1.9.2",
"whatwg-fetch": "^3.0.0"
"underscore": "^1.9.2"
},
"devDependencies": {
"@babel/core": "^7.8.3",
@@ -105,7 +105,6 @@
"redux-mock-store": "^1.5.4",
"sass-loader": "^8.0.2",
"seamless-immutable": "^7.1.3",
"sinon": "^8.1.1",
"sinon-chrome": "^3.0.1",
"svg-url-loader": "^3.0.3",
"underscore-template-loader": "^1.0.0",
@@ -12,8 +12,6 @@
*/

import _ from 'underscore';
import sinon from 'sinon';
import 'whatwg-fetch';
import bugDb from '../../src/classes/BugDb';
import conf from '../../src/classes/Conf';
import { prefsGet } from '../../src/utils/common';
@@ -11,7 +11,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import sinon from 'sinon';
import chrome from 'sinon-chrome';
import conf from '../../src/classes/Conf';
import globals from '../../src/classes/Globals';
@@ -12,8 +12,6 @@
*/

import _ from 'underscore';
import sinon from 'sinon';
import 'whatwg-fetch';
import bugDb from '../../src/classes/BugDb';
import conf from '../../src/classes/Conf';
import foundBugs from '../../src/classes/FoundBugs';
@@ -11,8 +11,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import sinon from 'sinon';
import 'whatwg-fetch';
import bugDb from '../../src/classes/BugDb';
import conf from '../../src/classes/Conf';
import { isBug } from '../../src/utils/matcher';
@@ -110,6 +110,8 @@ describe('tests for semverCompare()', () => {
expect(semverCompare("8.7.1", "8.7.10")).toBe(-1);
expect(semverCompare("7.100.100", "8.7.10")).toBe(-1);
expect(semverCompare("8.3.3", "8.4.2")).toBe(-1);
expect(semverCompare("8.3.3.3e794d0", "8.4.2")).toBe(-1);
expect(semverCompare("8.3.3.3e794d0", "8.4.2.1d945f0")).toBe(-1);
expect(semverCompare("8.7", "8.7.0")).toBe(-1);
expect(semverCompare("8.7", "8.8.0")).toBe(-1);

@@ -119,6 +121,8 @@ describe('tests for semverCompare()', () => {
expect(semverCompare("8.7.10", "8.7.1")).toBe(1);
expect(semverCompare("8.7.10", "7.100.100")).toBe(1);
expect(semverCompare("8.4.2", "8.3.3")).toBe(1);
expect(semverCompare("8.4.2", "8.3.3.3e794d0")).toBe(1);
expect(semverCompare("8.4.2.1d945f0", "8.3.3.3e794d0")).toBe(1);
expect(semverCompare("8.7.0", "8.7")).toBe(1);
expect(semverCompare("8.8.0", "8.7")).toBe(1);

@@ -623,7 +623,7 @@
resolved "https://registry.yarnpkg.com/@remusao/trie/-/trie-1.3.0.tgz#146b6f7f223d29db7106c19b9f4d4fab2754986a"
integrity sha512-IykMLl0vr8L1sJzvtGR4izkNh1Ous2njaeC4NEvAcfALCdCo7Y4VpISU0I8DaZFU2lGAFKyeh2Jz4WaM/3hbEw==

"@sinonjs/commons@^1", "@sinonjs/commons@^1.3.0", "@sinonjs/commons@^1.4.0", "@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0":
"@sinonjs/commons@^1", "@sinonjs/commons@^1.3.0", "@sinonjs/commons@^1.4.0", "@sinonjs/commons@^1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.7.0.tgz#f90ffc52a2e519f018b13b6c4da03cbff36ebed6"
integrity sha512-qbk9AP+cZUsKdW1GJsBpxPKFmCJ0T8swwzVje3qFd+AkQb74Q/tiuzrdfFg8AD2g5HH/XbE/I8Uc1KYHVYWfhg==
@@ -638,14 +638,6 @@
"@sinonjs/commons" "^1"
"@sinonjs/samsam" "^3.1.0"

"@sinonjs/formatio@^4.0.1":
version "4.0.1"
resolved "https://registry.yarnpkg.com/@sinonjs/formatio/-/formatio-4.0.1.tgz#50ac1da0c3eaea117ca258b06f4f88a471668bdb"
integrity sha512-asIdlLFrla/WZybhm0C8eEzaDNNrzymiTqHMeJl6zPW2881l3uuVRpm0QlRQEjqYWv6CcKMGYME3LbrLJsORBw==
dependencies:
"@sinonjs/commons" "^1"
"@sinonjs/samsam" "^4.2.0"

"@sinonjs/samsam@^3.1.0", "@sinonjs/samsam@^3.3.3":
version "3.3.3"
resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-3.3.3.tgz#46682efd9967b259b81136b9f120fd54585feb4a"
@@ -655,15 +647,6 @@
array-from "^2.1.1"
lodash "^4.17.15"

"@sinonjs/samsam@^4.2.0", "@sinonjs/samsam@^4.2.2":
version "4.2.2"
resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-4.2.2.tgz#0f6cb40e467865306d8a20a97543a94005204e23"
integrity sha512-z9o4LZUzSD9Hl22zV38aXNykgFeVj8acqfFabCY6FY83n/6s/XwNJyYYldz6/9lBJanpno9h+oL6HTISkviweA==
dependencies:
"@sinonjs/commons" "^1.6.0"
lodash.get "^4.4.2"
type-detect "^4.0.8"

"@sinonjs/text-encoding@^0.7.1":
version "0.7.1"
resolved "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz#8da5c6530915653f3a1f38fd5f101d8c3f8079c5"
@@ -2721,11 +2704,6 @@ diff@^3.5.0:
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==

diff@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==

diffie-hellman@^5.0.0:
version "5.0.3"
resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875"
@@ -5472,11 +5450,6 @@ lodash.flattendeep@^4.4.0:
resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2"
integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=

lodash.get@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=

lodash.isequal@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
@@ -5502,7 +5475,7 @@ lolex@^4.2.0:
resolved "https://registry.yarnpkg.com/lolex/-/lolex-4.2.0.tgz#ddbd7f6213ca1ea5826901ab1222b65d714b3cd7"
integrity sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==

lolex@^5.0.0, lolex@^5.0.1, lolex@^5.1.2:
lolex@^5.0.0, lolex@^5.0.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/lolex/-/lolex-5.1.2.tgz#953694d098ce7c07bc5ed6d0e42bc6c0c6d5a367"
integrity sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A==
@@ -5950,18 +5923,6 @@ nise@^1.5.2:
lolex "^5.0.1"
path-to-regexp "^1.7.0"

nise@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/nise/-/nise-3.0.1.tgz#0659982af515e5aac15592226246243e8da0013d"
integrity sha512-fYcH9y0drBGSoi88kvhpbZEsenX58Yr+wOJ4/Mi1K4cy+iGP/a73gNoyNhu5E9QxPdgTlVChfIaAlnyOy/gHUA==
dependencies:
"@sinonjs/commons" "^1.7.0"
"@sinonjs/formatio" "^4.0.1"
"@sinonjs/text-encoding" "^0.7.1"
just-extend "^4.0.2"
lolex "^5.0.1"
path-to-regexp "^1.7.0"

node-fetch@2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd"
@@ -7864,19 +7825,6 @@ sinon@^7.2.3:
nise "^1.5.2"
supports-color "^5.5.0"

sinon@^8.1.1:
version "8.1.1"
resolved "https://registry.yarnpkg.com/sinon/-/sinon-8.1.1.tgz#21fffd5ad0a2d072a8aa7f8a3cf7ed2ced497497"
integrity sha512-E+tWr3acRdoe1nXbHMu86SSqA1WGM7Yw3jZRLvlCMnXwTHP8lgFFVn5BnKnF26uc5SfZ3D7pA9sN7S3Y2jG4Ew==
dependencies:
"@sinonjs/commons" "^1.7.0"
"@sinonjs/formatio" "^4.0.1"
"@sinonjs/samsam" "^4.2.2"
diff "^4.0.2"
lolex "^5.1.2"
nise "^3.0.1"
supports-color "^7.1.0"

sisteransi@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.4.tgz#386713f1ef688c7c0304dc4c0632898941cad2e3"
@@ -8675,7 +8623,7 @@ type-check@~0.3.2:
dependencies:
prelude-ls "~1.1.2"

type-detect@4.0.8, type-detect@^4.0.8:
type-detect@4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"
integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==
@@ -9129,7 +9077,7 @@ whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.5:
dependencies:
iconv-lite "0.4.24"

whatwg-fetch@3.0.0, whatwg-fetch@>=0.10.0, whatwg-fetch@^3.0.0:
whatwg-fetch@3.0.0, whatwg-fetch@>=0.10.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb"
integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==
ProTip! Use n and p to navigate between commits in a pull request.