Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nialexsan committed Sep 18, 2024
1 parent f1c31d3 commit 6fa32a6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/providers/Project/projectDefault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function createLocalProject(
const accountEntities: Account[] = accounts.map((_account) => {
return {
__typename: 'Account',
address: _account.padStart(16, "0"),
address: _account.padStart(16, '0'),
deployedContracts: [],
state: DEFAULT_ACCOUNT_STATE,
};
Expand Down
23 changes: 10 additions & 13 deletions src/util/parser.test.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
import { extractSigners } from "./parser";
import { extractSigners } from './parser';

const oneSigner = `
transaction {
prepare(acct: auth(LoadValue, SaveValue) &Account) {}
}`

}`;

const twoSigners = `
transaction {
prepare(authorizer1: auth(Capabilities,SomethingElse) &Account, authorizer2: auth(Storage,Vaults) &Account) { }
}`
}`;

describe('parser tests', () => {

Check failure on line 13 in src/util/parser.test.ts

View workflow job for this annotation

GitHub Actions / Linter and Unit Tests (16.x)

Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.
it('should extract one code signer', () => {

Check failure on line 14 in src/util/parser.test.ts

View workflow job for this annotation

GitHub Actions / Linter and Unit Tests (16.x)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.
const signers = extractSigners(oneSigner);

const signers = extractSigners(oneSigner)

expect(signers).toHaveLength(1)
})
expect(signers).toHaveLength(1);

Check failure on line 17 in src/util/parser.test.ts

View workflow job for this annotation

GitHub Actions / Linter and Unit Tests (16.x)

Cannot find name 'expect'.
});
it('should extract two code signer', () => {

Check failure on line 19 in src/util/parser.test.ts

View workflow job for this annotation

GitHub Actions / Linter and Unit Tests (16.x)

Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.
const signers = extractSigners(twoSigners);

const signers = extractSigners(twoSigners)

expect(signers).toHaveLength(2)
})
})
expect(signers).toHaveLength(2);

Check failure on line 22 in src/util/parser.test.ts

View workflow job for this annotation

GitHub Actions / Linter and Unit Tests (16.x)

Cannot find name 'expect'.
});
});
2 changes: 1 addition & 1 deletion src/util/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const generateSchema = (argsDefinition: string) =>
return match.replace(/,/g, '<COMMA>');
})
.split(',')
.map((item) => item.replace(/\s*/g, '').replace(/<COMMA>/g,','))
.map((item) => item.replace(/\s*/g, '').replace(/<COMMA>/g, ','))
.filter((item) => item !== '');

export const stripComments = (code: string) => {
Expand Down

0 comments on commit 6fa32a6

Please sign in to comment.