-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bdcd719
commit f203f82
Showing
8 changed files
with
42 additions
and
79 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -2731,11 +2731,6 @@ | |
resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz" | ||
integrity sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag== | ||
|
||
"@types/mocha@^10.0.6": | ||
version "10.0.6" | ||
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.6.tgz#818551d39113081048bdddbef96701b4e8bb9d1b" | ||
integrity sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg== | ||
|
||
"@types/mute-stream@^0.0.4": | ||
version "0.0.4" | ||
resolved "https://registry.yarnpkg.com/@types/mute-stream/-/mute-stream-0.0.4.tgz#77208e56a08767af6c5e1237be8888e2f255c478" | ||
|
@@ -3424,11 +3419,6 @@ [email protected], assert-plus@^1.0.0: | |
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" | ||
integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== | ||
|
||
assertion-error@^1.1.0: | ||
version "1.1.0" | ||
resolved "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz" | ||
integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== | ||
|
||
ast-parents@^0.0.1: | ||
version "0.0.1" | ||
resolved "https://registry.yarnpkg.com/ast-parents/-/ast-parents-0.0.1.tgz#508fd0f05d0c48775d9eccda2e174423261e8dd3" | ||
|
@@ -4067,19 +4057,6 @@ catering@^2.1.0, catering@^2.1.1: | |
resolved "https://registry.npmjs.org/catering/-/catering-2.1.1.tgz" | ||
integrity sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w== | ||
|
||
chai@^4.3.10: | ||
version "4.3.10" | ||
resolved "https://registry.npmjs.org/chai/-/chai-4.3.10.tgz" | ||
integrity sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g== | ||
dependencies: | ||
assertion-error "^1.1.0" | ||
check-error "^1.0.3" | ||
deep-eql "^4.1.3" | ||
get-func-name "^2.0.2" | ||
loupe "^2.3.6" | ||
pathval "^1.1.1" | ||
type-detect "^4.0.8" | ||
|
||
[email protected], chalk@^5.2.0: | ||
version "5.3.0" | ||
resolved "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz" | ||
|
@@ -4112,13 +4089,6 @@ chardet@^0.7.0: | |
resolved "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz" | ||
integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== | ||
|
||
check-error@^1.0.3: | ||
version "1.0.3" | ||
resolved "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz" | ||
integrity sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg== | ||
dependencies: | ||
get-func-name "^2.0.2" | ||
|
||
checkpoint-store@^1.1.0: | ||
version "1.1.0" | ||
resolved "https://registry.yarnpkg.com/checkpoint-store/-/checkpoint-store-1.1.0.tgz#04e4cb516b91433893581e6d4601a78e9552ea06" | ||
|
@@ -4734,13 +4704,6 @@ dedent@^1.0.0: | |
resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.1.tgz#4f3fc94c8b711e9bb2800d185cd6ad20f2a90aff" | ||
integrity sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg== | ||
|
||
deep-eql@^4.1.3: | ||
version "4.1.3" | ||
resolved "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz" | ||
integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== | ||
dependencies: | ||
type-detect "^4.0.0" | ||
|
||
deep-extend@^0.6.0: | ||
version "0.6.0" | ||
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" | ||
|
@@ -6467,11 +6430,6 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: | |
resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" | ||
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== | ||
|
||
get-func-name@^2.0.1, get-func-name@^2.0.2: | ||
version "2.0.2" | ||
resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz" | ||
integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== | ||
|
||
get-intrinsic@^1.0.2, get-intrinsic@^1.1.3: | ||
version "1.2.1" | ||
resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz" | ||
|
@@ -8551,13 +8509,6 @@ loose-envify@^1.1.0, loose-envify@^1.4.0: | |
dependencies: | ||
js-tokens "^3.0.0 || ^4.0.0" | ||
|
||
loupe@^2.3.6: | ||
version "2.3.7" | ||
resolved "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz" | ||
integrity sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA== | ||
dependencies: | ||
get-func-name "^2.0.1" | ||
|
||
lowercase-keys@^2.0.0: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" | ||
|
@@ -9579,11 +9530,6 @@ path-type@^4.0.0: | |
resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" | ||
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== | ||
|
||
pathval@^1.1.1: | ||
version "1.1.1" | ||
resolved "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz" | ||
integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== | ||
|
||
pbkdf2@^3.0.17: | ||
version "3.1.2" | ||
resolved "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz" | ||
|
@@ -11428,7 +11374,7 @@ type-check@^0.4.0, type-check@~0.4.0: | |
dependencies: | ||
prelude-ls "^1.2.1" | ||
|
||
[email protected], type-detect@^4.0.0, type-detect@^4.0.8: | ||
[email protected], type-detect@^4.0.8: | ||
version "4.0.8" | ||
resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" | ||
integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== | ||
|