-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🪚 OmniGraph™ Use jest in utils-evm-test (#80)
- Loading branch information
1 parent
ced0ec9
commit 71a4b7f
Showing
13 changed files
with
91 additions
and
147 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
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 was deleted.
Oops, something went wrong.
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,17 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
testTimeout: 15000, | ||
moduleNameMapper: { | ||
"^@/(.*)\\.js$": "<rootDir>/src/$1", | ||
}, | ||
transform: { | ||
// ts-jest does not yet work great with node16 module resolution | ||
// so we need to help it a little | ||
// | ||
// See https://github.com/kulshekhar/ts-jest/issues/4207 for the issue | ||
// And https://github.com/kulshekhar/ts-jest/issues/4198 for another one | ||
"^.+\\.tsx?$": ["ts-jest", { tsconfig: "tsconfig.test.json" }], | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,31 +1,29 @@ | ||
import { expect } from 'chai' | ||
import { describe, it } from 'mocha' | ||
import { createExampleGitURL } from '../../src/utilities/cloning.js' | ||
import { createExampleGitURL } from '@/utilities/cloning.js' | ||
|
||
describe('utilities/cloning', () => { | ||
describe('createExampleGitURL', () => { | ||
const REPO_URL = '[email protected]:LayerZero-Labs/lz-utils' | ||
|
||
it('should return the repository field if directory and ref are not specified', () => { | ||
expect(createExampleGitURL({ repository: REPO_URL, id: 'dummy', label: 'Dummy' })).to.eql(REPO_URL) | ||
expect(createExampleGitURL({ repository: REPO_URL, id: 'dummy', label: 'Dummy' })).toEqual(REPO_URL) | ||
}) | ||
|
||
it('should return the repository field with directory if directory is specified', () => { | ||
expect(createExampleGitURL({ repository: REPO_URL, directory: 'dir', id: 'dummy', label: 'Dummy' })).to.eql( | ||
`${REPO_URL}/dir` | ||
) | ||
expect( | ||
createExampleGitURL({ repository: REPO_URL, directory: 'dir', id: 'dummy', label: 'Dummy' }) | ||
).toEqual(`${REPO_URL}/dir`) | ||
expect( | ||
createExampleGitURL({ repository: REPO_URL, directory: '/dir', id: 'dummy', label: 'Dummy' }) | ||
).to.eql(`${REPO_URL}/dir`) | ||
).toEqual(`${REPO_URL}/dir`) | ||
expect( | ||
createExampleGitURL({ repository: REPO_URL, directory: 'dir', ref: '', id: 'dummy', label: 'Dummy' }) | ||
).to.eql(`${REPO_URL}/dir`) | ||
).toEqual(`${REPO_URL}/dir`) | ||
}) | ||
|
||
it('should return the repository field with directory and ref if directory and ref are specified', () => { | ||
expect( | ||
createExampleGitURL({ repository: REPO_URL, directory: 'dir', ref: 'ref', id: 'dummy', label: 'Dummy' }) | ||
).to.eql(`${REPO_URL}/dir#ref`) | ||
).toEqual(`${REPO_URL}/dir#ref`) | ||
expect( | ||
createExampleGitURL({ | ||
repository: REPO_URL, | ||
|
@@ -34,14 +32,14 @@ describe('utilities/cloning', () => { | |
id: 'dummy', | ||
label: 'Dummy', | ||
}) | ||
).to.eql(`${REPO_URL}/dir#ref`) | ||
).toEqual(`${REPO_URL}/dir#ref`) | ||
}) | ||
|
||
it('should return the repository field with ref if only ref specified', () => { | ||
expect(createExampleGitURL({ repository: REPO_URL, ref: 'ref', id: 'dummy', label: 'Dummy' })).to.eql( | ||
expect(createExampleGitURL({ repository: REPO_URL, ref: 'ref', id: 'dummy', label: 'Dummy' })).toEqual( | ||
`${REPO_URL}#ref` | ||
) | ||
expect(createExampleGitURL({ repository: REPO_URL, ref: '#ref', id: 'dummy', label: 'Dummy' })).to.eql( | ||
expect(createExampleGitURL({ repository: REPO_URL, ref: '#ref', id: 'dummy', label: 'Dummy' })).toEqual( | ||
`${REPO_URL}#ref` | ||
) | ||
}) | ||
|
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,7 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"module": "ESNext", | ||
"moduleResolution": "Node10" | ||
} | ||
} |
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,9 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
testTimeout: 15000, | ||
moduleNameMapper: { | ||
'^@/(.*)$': '<rootDir>/src/$1', | ||
}, | ||
}; |
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
Oops, something went wrong.