commit
6fcb8a3492
@ -0,0 +1,15 @@ |
|||||||
|
import { NightwatchBrowser } from 'nightwatch' |
||||||
|
import EventEmitter from 'events' |
||||||
|
|
||||||
|
class CurrentSelectedFileIs extends EventEmitter { |
||||||
|
command (this: NightwatchBrowser, value: string): NightwatchBrowser { |
||||||
|
this.api |
||||||
|
.waitForElementContainsText('*[data-id="tabs-component"] *[data-id="tab-active"]', value) |
||||||
|
.perform(() => { |
||||||
|
this.emit('complete') |
||||||
|
}) |
||||||
|
return this |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
module.exports = CurrentSelectedFileIs |
Before Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,24 @@ |
|||||||
|
module.exports = { |
||||||
|
name: 'remix-solidity', |
||||||
|
preset: '../../jest.config.js', |
||||||
|
verbose: true, |
||||||
|
silent: false, // Silent console messages, specially the 'remix-simulator' ones
|
||||||
|
transform: { |
||||||
|
'^.+\\.[tj]sx?$': 'ts-jest', |
||||||
|
}, |
||||||
|
transformIgnorePatterns: ["/node_modules/", "/dist/", "\\.pnp\\.[^\\\/]+$"], |
||||||
|
rootDir: "./", |
||||||
|
testTimeout: 40000, |
||||||
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html', 'json'], |
||||||
|
// Coverage
|
||||||
|
collectCoverage: true, |
||||||
|
coverageReporters: ['text', 'text-summary'], |
||||||
|
collectCoverageFrom: [ |
||||||
|
"**/*.ts", |
||||||
|
"!**/sol/**", |
||||||
|
"!src/types.ts", |
||||||
|
"!src/logger.ts" |
||||||
|
], |
||||||
|
coverageDirectory: '../../coverage/libs/remix-solidity' |
||||||
|
}; |
||||||
|
|
@ -1,6 +1,6 @@ |
|||||||
export { Compiler } from './compiler/compiler' |
export { Compiler } from './compiler/compiler' |
||||||
export { compile } from './compiler/compiler-helpers' |
export { compile } from './compiler/compiler-helpers' |
||||||
export { default as CompilerInput } from './compiler/compiler-input' |
export { default as CompilerInput, getValidLanguage } from './compiler/compiler-input' |
||||||
export { CompilerAbstract } from './compiler/compiler-abstract' |
export { CompilerAbstract } from './compiler/compiler-abstract' |
||||||
export * from './compiler/types' |
export * from './compiler/types' |
||||||
export { promisedMiniXhr, pathToURL, baseURLBin, baseURLWasm, canUseWorker, urlFromVersion } from './compiler/compiler-utils' |
export { promisedMiniXhr, pathToURL, baseURLBin, baseURLWasm, canUseWorker, urlFromVersion } from './compiler/compiler-utils' |
||||||
|
@ -0,0 +1,25 @@ |
|||||||
|
import { getValidLanguage } from '../src/compiler/compiler-input' |
||||||
|
import { Language } from '../src/compiler/types' |
||||||
|
|
||||||
|
describe('compiler-input', () => { |
||||||
|
test('getValidLanguage', () => { |
||||||
|
const correctYul: Language = 'Yul' |
||||||
|
const correctSolidity: Language = 'Solidity' |
||||||
|
|
||||||
|
const yulUpperCase = 'Yul' |
||||||
|
const yulLowerCase = 'yul' |
||||||
|
|
||||||
|
const solidityUpperCase = 'Solidity' |
||||||
|
const solidityLowerCase = 'solidity' |
||||||
|
|
||||||
|
expect(getValidLanguage(yulLowerCase)).toBe(correctYul) |
||||||
|
expect(getValidLanguage(yulUpperCase)).toBe(correctYul) |
||||||
|
expect(getValidLanguage(solidityUpperCase)).toBe(correctSolidity) |
||||||
|
expect(getValidLanguage(solidityLowerCase)).toBe(correctSolidity) |
||||||
|
expect(getValidLanguage(null)).toBe(null) |
||||||
|
expect(getValidLanguage(undefined)).toBe(null) |
||||||
|
expect(getValidLanguage('')).toBe(null) |
||||||
|
expect(getValidLanguage('A')).toBe(null) |
||||||
|
expect(getValidLanguage('Something')).toBe(null)
|
||||||
|
}) |
||||||
|
}) |
@ -1,7 +1,7 @@ |
|||||||
{ |
{ |
||||||
"extends": "../../tsconfig.base.json", |
"extends": "../../tsconfig.base.json", |
||||||
"compilerOptions": { |
"compilerOptions": { |
||||||
"types": ["node"] |
"types": ["jest", "node"] |
||||||
}, |
}, |
||||||
"include": ["**/*.ts"] |
"include": ["**/*.ts"] |
||||||
} |
} |
Loading…
Reference in new issue