Skip to content

Commit

Permalink
test: update jest types
Browse files Browse the repository at this point in the history
  • Loading branch information
SkeLLLa committed Jun 17, 2021
1 parent 7b1d04d commit b1a7774
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 213 deletions.
196 changes: 0 additions & 196 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"devDependencies": {
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@types/jest": "^26.0.23",
"@jest/globals": "^27.0.3",
"@types/node": "^15.12.2",
"@typescript-eslint/eslint-plugin": "^4.27.0",
"@typescript-eslint/parser": "^4.27.0",
Expand Down
28 changes: 14 additions & 14 deletions test/compatibility.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'jest';
import { describe, test, expect } from '@jest/globals';
import hasher = require('../src/hasher');
import { SortOptions } from '../src/objectSorter';

Expand Down Expand Up @@ -347,27 +347,27 @@ describe('Backward compatibility', () => {
});

describe('hash', () => {
it('should return equal hashes', function () {
test('should return equal hashes', function () {
expect(hash.hash(testData.objects.noSort)).toEqual(
hash.hash(testData.objects.sort)
);
});
it('should return equal hashes', function () {
test('should return equal hashes', function () {
expect(hash.hash(testData.objects.noCoerce)).toEqual(
hash.hash(testData.objects.coerce)
);
});
it('should return equal hashes', function () {
test('should return equal hashes', function () {
expect(hash.hash(testData.objects.sort)).toEqual(
hash.hash(testData.objects.sortCoerce)
);
});
it('should return equal hashes', function () {
test('should return equal hashes', function () {
expect(hash.hash(testData.objects.coerce)).toEqual(
hash.hash(testData.objects.sortCoerce)
);
});
it('should return equal hashes', function () {
test('should return equal hashes', function () {
expect(hash.hash(testData.objects.coerce)).toEqual(
hash.hash(testData.objects.sortCoerce)
);
Expand All @@ -378,22 +378,22 @@ describe('Backward compatibility', () => {
describe('sort=false coerce=true', () => {
const hash = hasher({ sort: false });

it('should return different strings', function () {
test('should return different strings', function () {
expect(hash.sort(testData.objects.noSort)).not.toEqual(
hash.sort(testData.objects.sort)
);
});
it('should return different strings', function () {
test('should return different strings', function () {
expect(hash.sort(testData.objects.noCoerce)).not.toEqual(
hash.sort(testData.objects.sortCoerce)
);
});
it('should return equal strings', function () {
test('should return equal strings', function () {
expect(hash.sort(testData.objects.noCoerce)).toEqual(
hash.sort(testData.objects.coerce)
);
});
it('should return equal strings', function () {
test('should return equal strings', function () {
expect(hash.sort(testData.objects.noCoerce)).toEqual(
hash.sort(testData.objects.noSort)
);
Expand Down Expand Up @@ -492,16 +492,16 @@ describe('Backward compatibility', () => {
object: new UnknownClass(),
};

describe.each(Object.keys(types))('type: %s', (typeKey) => {
describe.each(Object.keys(types))('type: %s', (typeKey: string) => {
describe.each(Object.keys(coerceOptions))(
'coerce option %s',
(coerceKey) => {
(coerceKey: string) => {
describe.each(Object.keys(sortOptions))(
'sort option: %s',
(sortKey) => {
(sortKey: string) => {
describe.each(Object.keys(trimOptions))(
'trim option: %s',
(trimKey) => {
(trimKey: string) => {
const type = types[typeKey];
const coerce = coerceOptions[coerceKey];
const sort = sortOptions[sortKey];
Expand Down
2 changes: 1 addition & 1 deletion test/hasher.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'jest';
import { describe, test, expect } from '@jest/globals';
import { Hashable } from '../src/hasher';
import hasher = require('../src/hasher');

Expand Down
2 changes: 1 addition & 1 deletion test/objectSorter.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'jest';
import { describe, test, expect } from '@jest/globals';
import hasher = require('../src/hasher');
import sorter = require('../src/objectSorter');

Expand Down

0 comments on commit b1a7774

Please sign in to comment.