Skip to content

Commit

Permalink
@1.0.7 - update devdeps, eslint 9+
Browse files Browse the repository at this point in the history
  • Loading branch information
localnerve committed Apr 12, 2024
1 parent b6f256e commit 3b73aea
Show file tree
Hide file tree
Showing 9 changed files with 937 additions and 638 deletions.
15 changes: 0 additions & 15 deletions .eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion __test_package__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Copyright (c) 2023-2024 Alex Grant (@localnerve), LocalNerve LLC
* Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
*/
/* global Promise */
const { spawn, spawnSync } = require('node:child_process');
const fs = require('node:fs');
const path = require('node:path');
Expand Down
3 changes: 1 addition & 2 deletions __tests__/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Copyright (c) 2023-2024 Alex Grant (@localnerve), LocalNerve LLC
* Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
*/
/* eslint-env jest */
import { HSError } from '../lib/errors.js';

describe('HSError', () => {
Expand All @@ -16,6 +15,6 @@ describe('HSError', () => {

expect(err.hseType === HSError.HSE_HMAC).toBeTruthy();
expect(err.message === message).toBeTruthy();
expect(err.name === 'HSError');
expect(err.name === 'HSError').toBeTruthy();
});
});
1 change: 0 additions & 1 deletion __tests__/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* Copyright (c) 2023-2024 Alex Grant (@localnerve), LocalNerve LLC
* Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
*/
/* eslint-env jest */
import { encryptAndDigest, decryptAndTest } from '../lib/helpers.js';

const input = 'hello world';
Expand Down
1 change: 0 additions & 1 deletion __tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Copyright (c) 2023-2024 Alex Grant (@localnerve), LocalNerve LLC
* Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
*/
/* eslint-env jest */
import {
HSError,
generateHmac,
Expand Down
7 changes: 6 additions & 1 deletion __tests__/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* Copyright (c) 2023-2024 Alex Grant (@localnerve), LocalNerve LLC
* Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
*/
/* eslint-env jest */
import { HSError } from '../lib/errors.js';
import { generateHmac, symmetricEncrypt, symmetricDecrypt } from '../lib/utils.js';

Expand All @@ -29,6 +28,7 @@ describe('generateHmac', () => {
}).toThrow(HSError)
});

/* eslint-disable jest/no-conditional-expect */
test('bad algo, error type', () => {
try {
generateHmac(input, {
Expand All @@ -39,6 +39,7 @@ describe('generateHmac', () => {
expect(e.hseType).toEqual(HSError.HSE_HMAC);
}
});
/* eslint-enable jest/no-conditional-expect */
});

describe('symmetricEncrypt', () => {
Expand All @@ -56,6 +57,7 @@ describe('symmetricEncrypt', () => {
}).toThrow(HSError);
});

/* eslint-disable jest/no-conditional-expect */
test('bad algo, error type', () => {
try {
symmetricEncrypt(input, {
Expand All @@ -66,6 +68,7 @@ describe('symmetricEncrypt', () => {
expect(e.hseType).toEqual(HSError.HSE_ENCRYPT);
}
});
/* eslint-enable jest/no-conditional-expect */
});

describe('symmetricDecrypt', () => {
Expand All @@ -84,6 +87,7 @@ describe('symmetricDecrypt', () => {
}).toThrow(HSError);
});

/* eslint-disable jest/no-conditional-expect */
test('bad algo, error type', () => {
try {
symmetricDecrypt('one:two', {
Expand All @@ -94,4 +98,5 @@ describe('symmetricDecrypt', () => {
expect(e.hseType).toEqual(HSError.HSE_DECRYPT);
}
});
/* eslint-enable jest/no-conditional-expect */
});
39 changes: 39 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import js from '@eslint/js';
import globals from 'globals';
import jest from 'eslint-plugin-jest';

export default [{
ignores: [
'cjs/**',
'coverage/**',
'node_modules/**',
'**/tmp/**'
]
}, {
files: [
'lib/**',
'__test_package__/*.mjs'
],
...js.configs.recommended,
languageOptions: {
globals: {
...globals.node
}
}
}, {
files: [
'__test_package__/*.{js,cjs}'
],
...js.configs.recommended,
languageOptions: {
sourceType: 'commonjs',
globals: {
...globals.node
}
}
}, {
files: [
'__tests__/**'
],
...jest.configs['flat/recommended']
}]
Loading

0 comments on commit 3b73aea

Please sign in to comment.