Skip to content

Commit

Permalink
chore(release): publish 3.6.9-alpha.6 --tag=alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
bigmeow committed Jun 26, 2023
1 parent 67d6c38 commit 462d4d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/taro-cli/src/__tests__/dotenv-parse.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe('inspect', () => {
delete process.env.TARO_APP_ID
delete process.env.JD_APP_TEST
delete process.env.TARO_APP_DEFAULT
delete process.env.TARO_APP_FOO
})

afterEach(() => {
Expand All @@ -40,6 +41,7 @@ describe('inspect', () => {
delete process.env.TARO_APP_ID
delete process.env.JD_APP_TEST
delete process.env.TARO_APP_DEFAULT
delete process.env.TARO_APP_FOO
})

describe('cli mode env', () => {
Expand Down Expand Up @@ -93,5 +95,11 @@ describe('inspect', () => {
expect(process.env.TARO_APP_TEST).toEqual(undefined)
expect(process.env.TARO_APP_ID).toEqual('特殊变量appid')
})

it('环境变量可以相互引用', async () => {
setProcessArgv('taro build --type weapp --mode pre')
await cli.run()
expect(process.env.TARO_APP_FOO).toEqual('env-pre-foo')
})
})
})
4 changes: 3 additions & 1 deletion packages/taro-cli/src/__tests__/fixtures/default/.env.pre
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
TARO_APP_TEST=env-pre
TARO_APP_TEST=env-pre

TARO_APP_FOO=${TARO_APP_TEST}-foo

0 comments on commit 462d4d4

Please sign in to comment.