Skip to content

Commit

Permalink
Add OApp Read to create-lz-oapp
Browse files Browse the repository at this point in the history
  • Loading branch information
yargo13 committed Nov 14, 2024
1 parent e2395b5 commit ce60c9f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/create-lz-oapp/test/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,17 @@ describe('config', () => {

expect(getExamples()).toContainEqual(expect.objectContaining({ id: 'oft-solana' }))
})

it('should not include OApp Read example if LZ_ENABLE_READ_EXAMPLE is empty', () => {
process.env.LZ_ENABLE_READ_EXAMPLE = ''

expect(getExamples()).not.toContainEqual(expect.objectContaining({ id: 'oapp-read' }))
})

it('should include OApp Read example if LZ_ENABLE_READ_EXAMPLE is defined', () => {
process.env.LZ_ENABLE_READ_EXAMPLE = 'yes'

expect(getExamples()).toContainEqual(expect.objectContaining({ id: 'oapp-read' }))
})
})
})
27 changes: 27 additions & 0 deletions tests-user/tests/create-lz-oapp.bats
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,15 @@ teardown() {
pnpm test
}

@test "should work with pnpm & oapp read example in CI mode" {
local DESTINATION="$PROJECTS_DIRECTORY/pnpm-oapp-read"

LZ_ENABLE_READ_EXAMPLE=1 npx --yes create-lz-oapp --ci --example oapp-read --destination $DESTINATION --package-manager pnpm
cd "$DESTINATION"
pnpm compile
pnpm test
}

@test "should work with yarn & oapp example in CI mode" {
local DESTINATION="$PROJECTS_DIRECTORY/yarn-oapp"

Expand Down Expand Up @@ -242,6 +251,15 @@ teardown() {
yarn test
}

@test "should work with yarn & oapp read example in CI mode" {
local DESTINATION="$PROJECTS_DIRECTORY/yarn-oapp-read"

YARN_CACHE_FOLDER="/tmp/.yarn-cache-oapp-read" LZ_ENABLE_READ_EXAMPLE=1 npx --yes create-lz-oapp --ci --example oapp-read --destination $DESTINATION --package-manager yarn
cd "$DESTINATION"
pnpm compile
pnpm test
}

@test "should work with npm & oapp example in CI mode" {
local DESTINATION="$PROJECTS_DIRECTORY/npm-oapp"

Expand Down Expand Up @@ -305,3 +323,12 @@ teardown() {
npm run compile
npm run test
}

@test "should work with npm & oapp read example in CI mode" {
local DESTINATION="$PROJECTS_DIRECTORY/npm-oapp-read"

LZ_ENABLE_READ_EXAMPLE=1 npx --yes create-lz-oapp --ci --example oapp-read --destination $DESTINATION --package-manager npm
cd "$DESTINATION"
pnpm compile
pnpm test
}
1 change: 1 addition & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"LZ_ENABLE_EXPERIMENTAL_RETRY",
"LZ_ENABLE_EXPERIMENTAL_SIMULATION",
"LZ_ENABLE_EXPERIMENTAL_SOLANA_OFT_EXAMPLE",
"LZ_ENABLE_READ_EXAMPLE",

"LAYERZERO_EXAMPLES_REPOSITORY_URL",
"LAYERZERO_EXAMPLES_REPOSITORY_REF",
Expand Down

0 comments on commit ce60c9f

Please sign in to comment.