From 2df970be553f5a874d1c97185748815bee33413f Mon Sep 17 00:00:00 2001 From: lianahus Date: Tue, 30 Apr 2024 11:20:57 +0200 Subject: [PATCH] fixing linting for remix-tests --- apps/solhint/project.json | 4 ++-- libs/remix-tests/src/compiler.ts | 4 ++-- libs/remix-tests/tests/testRunner.cli.spec.ts | 7 ++----- libs/remix-tests/tests/testRunner.spec.ts | 4 ---- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/apps/solhint/project.json b/apps/solhint/project.json index a76ec45b49..c8d6075771 100644 --- a/apps/solhint/project.json +++ b/apps/solhint/project.json @@ -51,8 +51,8 @@ "executor": "@nrwl/linter:eslint", "outputs": ["{options.outputFile}"], "options": { - "lintFilePatterns": ["libs/solhint/**/*.ts"], - "eslintConfig": "libs/solhint/.eslintrc" + "lintFilePatterns": ["apps/solhint/**/*.ts"], + "eslintConfig": "apps/solhint/.eslintrc" } }, "serve": { diff --git a/libs/remix-tests/src/compiler.ts b/libs/remix-tests/src/compiler.ts index 591609c5a8..1c6f7e8064 100644 --- a/libs/remix-tests/src/compiler.ts +++ b/libs/remix-tests/src/compiler.ts @@ -25,7 +25,7 @@ export function writeTestAccountsContract (accounts: string[]) { body += `return accounts[index];` } else { body = `return address(0);` - } + } return testAccountContract.replace('>accounts<', body) } @@ -91,7 +91,7 @@ export function compileFileOrFiles (filename: string, isDirectory: boolean, opts const filepath: string = (isDirectory ? filename : path.dirname(filename)) const importsCallback = (url, cb) => { try { - if(fs.existsSync(url)) cb(null, fs.readFileSync(url, 'utf-8')) + if (fs.existsSync(url)) cb(null, fs.readFileSync(url, 'utf-8')) else { const urlResolver = new RemixURLResolver() urlResolver.resolve(url).then((result) => cb(null, result.content)).catch((error) => cb(error.message)) diff --git a/libs/remix-tests/tests/testRunner.cli.spec.ts b/libs/remix-tests/tests/testRunner.cli.spec.ts index 363e69cb8d..b1d8b97cf4 100644 --- a/libs/remix-tests/tests/testRunner.cli.spec.ts +++ b/libs/remix-tests/tests/testRunner.cli.spec.ts @@ -9,10 +9,10 @@ describe('testRunner: remix-tests CLI', function(){ const executablePath = resolve(__dirname + '/../../../dist/libs/remix-tests/bin/remix-tests') const result = spawnSync('ls', { cwd: resolve(__dirname + '/../../../dist/libs/remix-tests') }) - if(result) { + if (result) { const dirContent = result.stdout.toString() // Install dependencies if 'node_modules' is not already present - if(!dirContent.includes('node_modules')) { + if (!dirContent.includes('node_modules')) { execSync('yarn add @remix-project/remix-lib ../../libs/remix-lib', { cwd: resolve(__dirname + '/../../../dist/libs/remix-tests') }) execSync('yarn add @remix-project/remix-url-resolver ../../libs/remix-url-resolver', { cwd: resolve(__dirname + '/../../../dist/libs/remix-tests') }) execSync('yarn add @remix-project/remix-solidity ../../libs/remix-solidity', { cwd: resolve(__dirname + '/../../../dist/libs/remix-tests') }) @@ -21,7 +21,6 @@ describe('testRunner: remix-tests CLI', function(){ } } - describe('test various CLI options', function() { it('remix-tests version', () => { const res = spawnSync(executablePath, ['-V']) @@ -79,8 +78,6 @@ Commands: }) - - it('remix-tests running a test file with custom compiler version', () => { const res = spawnSync(executablePath, ['--compiler', '0.7.4', resolve(__dirname + '/examples_0/assert_ok_test.sol')]) // match initial lines diff --git a/libs/remix-tests/tests/testRunner.spec.ts b/libs/remix-tests/tests/testRunner.spec.ts index 799bdfb3f9..0d2dcf260d 100644 --- a/libs/remix-tests/tests/testRunner.spec.ts +++ b/libs/remix-tests/tests/testRunner.spec.ts @@ -8,8 +8,6 @@ import { deployAll } from '../src/deployer' import { runTest, compilationInterface } from '../src/index' import { ResultsInterface, TestCbInterface, ResultCbInterface } from '../src/index' - - // deepEqualExcluding allows us to exclude specific keys whose values vary. // In this specific test, we'll use this helper to exclude `time` keys. // Assertions for the existence of these will be made at the correct places. @@ -177,8 +175,6 @@ describe('testRunner', function () { }) }) - - describe('assert library NOTEQUAL method tests', function () { const filename: string = __dirname + '/examples_0/assert_notEqual_test.sol'