generated from digitalcredentials/isomorphic-lib-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds tests for MongoDB credential status manager with pre-test and po…
…st-test scripts; renames embedCredentialStatus to attachCredentialStatus; adds newUserCredential field to attachCredentialStatus output type in order to prevent unnecessary event creations; improves error reporting for mismatches in credential accounting; moves generateStatusCredentialId implementation back to class method; updates lint rules; fixes lint errors
- Loading branch information
Showing
14 changed files
with
535 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,22 @@ | ||
/*! | ||
* Copyright (c) 2023 Digital Credentials Consortium. All rights reserved. | ||
*/ | ||
module.exports = { | ||
overrides: [ | ||
{ | ||
files: ['*.js', '*.jsx', '*.ts', '*.tsx'], | ||
extends: 'standard-with-typescript', | ||
parserOptions: { | ||
project: './tsconfig.json' | ||
} | ||
} | ||
] | ||
root: true, | ||
extends: ['standard-with-typescript', 'prettier', 'eslint-config-prettier'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint', 'prettier'], | ||
parserOptions: { | ||
project: './tsconfig.json' | ||
}, | ||
ignorePatterns: ['dist', 'test'], | ||
rules: { | ||
'prettier/prettier': 'off', | ||
'arrow-body-style': 'off', | ||
'prefer-arrow-callback': 'off', | ||
'@typescript-eslint/prefer-ts-expect-error': 'off', | ||
'@typescript-eslint/return-await': 'off', | ||
'@typescript-eslint/strict-boolean-expressions': 'off', | ||
'no-empty-pattern': 'off' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const PackageJson = require('@npmcli/package-json'); | ||
const fs = require('fs'); | ||
|
||
// update package.json | ||
const updatePackageJson = async () => { | ||
const pkgJson = await PackageJson.load('./'); | ||
pkgJson.update({ type: 'module' }); | ||
await pkgJson.save(); | ||
}; | ||
|
||
// update tsconfig.spec.json | ||
const updateTsconfig = async () => { | ||
const tsconfigFilePath = './tsconfig.spec.json'; | ||
const tsconfigJson = require(tsconfigFilePath); | ||
tsconfigJson.compilerOptions.module = 'es2022'; | ||
fs.writeFileSync(tsconfigFilePath, JSON.stringify(tsconfigJson, null, 2) + '\n'); | ||
}; | ||
|
||
// combine post-test subscripts | ||
const runPostTest = async () => { | ||
await updatePackageJson(); | ||
await updateTsconfig(); | ||
}; | ||
|
||
// run post-test subscripts | ||
runPostTest(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import PackageJson from '@npmcli/package-json'; | ||
import fs from 'fs'; | ||
|
||
// update package.json | ||
const updatePackageJson = async () => { | ||
const pkgJson = await PackageJson.load('./'); | ||
pkgJson.update({ type: undefined }); | ||
await pkgJson.save(); | ||
}; | ||
|
||
// update tsconfig.spec.json | ||
const updateTsconfig = async () => { | ||
const tsconfigFilePath = './tsconfig.spec.json'; | ||
const tsconfigJson = JSON.parse(fs.readFileSync(tsconfigFilePath)); | ||
tsconfigJson.compilerOptions.module = 'commonjs'; | ||
fs.writeFileSync(tsconfigFilePath, JSON.stringify(tsconfigJson, null, 2) + '\n'); | ||
}; | ||
|
||
// combine pre-test subscripts | ||
const runPreTest = async () => { | ||
await updatePackageJson(); | ||
await updateTsconfig(); | ||
}; | ||
|
||
// run pre-test subscripts | ||
runPreTest(); |
Oops, something went wrong.