-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(test): 优化测试用例类型 & update snapshot
- Loading branch information
1 parent
e33da7c
commit 4c45ced
Showing
13 changed files
with
427 additions
and
259 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
import Taro from '@tarojs/api' | ||
|
||
import taro, { eventCenter } from '../../taro' | ||
const launchOptions: Taro.getLaunchOptionsSync.LaunchOptions = { | ||
path: '', | ||
query: {}, | ||
scene: 0, | ||
shareTicket: '', | ||
referrerInfo: {} | ||
} | ||
|
||
function initLaunchOptions (options = {}) { | ||
(taro as any).launchOptions = options | ||
Object.assign(launchOptions, options) | ||
} | ||
|
||
eventCenter.once('__taroRouterLaunch', initLaunchOptions) | ||
Taro.eventCenter.once('__taroRouterLaunch', initLaunchOptions) | ||
|
||
// 生命周期 | ||
export const getLaunchOptionsSync: typeof Taro.getLaunchOptionsSync = () => (taro as any).launchOptions | ||
export const getEnterOptionsSync: typeof Taro.getEnterOptionsSync = () => (taro as any).launchOptions | ||
export const getLaunchOptionsSync: typeof Taro.getLaunchOptionsSync = () => launchOptions | ||
export const getEnterOptionsSync: typeof Taro.getEnterOptionsSync = () => launchOptions |
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.