-
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.
🪲 Add missing ref option to native OFT adapter example in create-lz-o…
…app (#999)
- Loading branch information
1 parent
63ea17a
commit b773736
Showing
7 changed files
with
174 additions
and
102 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"create-lz-oapp": patch | ||
--- | ||
|
||
Fix ref option for native-oft-adapter example |
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
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,55 @@ | ||
import { getExamples } from '@/config' | ||
|
||
describe('config', () => { | ||
describe('getExamples()', () => { | ||
it('should use the default repository if LAYERZERO_EXAMPLES_REPOSITORY_URL is empty', () => { | ||
process.env.LAYERZERO_EXAMPLES_REPOSITORY_URL = '' | ||
|
||
const examples = getExamples() | ||
expect(examples).not.toEqual([]) | ||
|
||
examples.forEach((example) => | ||
expect(example).toMatchObject({ repository: 'https://github.com/LayerZero-Labs/devtools.git' }) | ||
) | ||
}) | ||
|
||
it('should use LAYERZERO_EXAMPLES_REPOSITORY_URL if LAYERZERO_EXAMPLES_REPOSITORY_URL is defined', () => { | ||
process.env.LAYERZERO_EXAMPLES_REPOSITORY_URL = 'my://little.devtools' | ||
|
||
const examples = getExamples() | ||
expect(examples).not.toEqual([]) | ||
|
||
examples.forEach((example) => expect(example).toMatchObject({ repository: 'my://little.devtools' })) | ||
}) | ||
|
||
it('should use the default ref if LAYERZERO_EXAMPLES_REPOSITORY_REF is empty', () => { | ||
process.env.LAYERZERO_EXAMPLES_REPOSITORY_REF = '' | ||
|
||
const examples = getExamples() | ||
expect(examples).not.toEqual([]) | ||
|
||
examples.forEach((example) => expect(example).toMatchObject({ ref: '' })) | ||
}) | ||
|
||
it('should use LAYERZERO_EXAMPLES_REPOSITORY_REF if LAYERZERO_EXAMPLES_REPOSITORY_REF is defined', () => { | ||
process.env.LAYERZERO_EXAMPLES_REPOSITORY_REF = 'ohhello' | ||
|
||
const examples = getExamples() | ||
expect(examples).not.toEqual([]) | ||
|
||
examples.forEach((example) => expect(example).toMatchObject({ ref: 'ohhello' })) | ||
}) | ||
|
||
it('should not include Solana OFT example if LZ_ENABLE_EXPERIMENTAL_SOLANA_OFT_EXAMPLE is empty', () => { | ||
process.env.LZ_ENABLE_EXPERIMENTAL_SOLANA_OFT_EXAMPLE = '' | ||
|
||
expect(getExamples()).not.toContainEqual(expect.objectContaining({ id: 'oft-solana' })) | ||
}) | ||
|
||
it('should include Solana OFT example if LZ_ENABLE_EXPERIMENTAL_SOLANA_OFT_EXAMPLE is defined', () => { | ||
process.env.LZ_ENABLE_EXPERIMENTAL_SOLANA_OFT_EXAMPLE = 'yes' | ||
|
||
expect(getExamples()).toContainEqual(expect.objectContaining({ id: 'oft-solana' })) | ||
}) | ||
}) | ||
}) |
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