-
Notifications
You must be signed in to change notification settings - Fork 8
TypeError: Cannot read property 'getRandomBase64' of undefined ] #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
package.jsonのreact-native-get-random-valuesのバージョンは"1.3.0"でしょうか?
jest.mock('react-native-get-random-values', () => ({
getRandomBase64: jest.fn(),
})); モックを追加してあげればテストで失敗しなくなるようです。 |
ありがとうございます。
試してみます。
2021年1月8日(金) 19:55 kyamashiro <[email protected]>:
… package.jsonのreact-native-get-random-valuesのバージョンは"1.3.0"でしょうか?
こちらの環境で試したところ"1.4.0","1.5.0"だとテストでエラーになるようです。
_mocks_ディレクトリ直下に空のreact-native-get-random-values.jsファイルを作成するか、もしくはこちらの
issue <LinusU/react-native-get-random-values#22>
にあるようにテストファイル内のdescribeの前に
jest.mock('react-native-get-random-values', () => ({
getRandomBase64: jest.fn(),
}));
モックを追加してあげればテストで失敗しなくなるようです。
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#72 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASBVXRXYZ3YUBO7YPIZ6453SY3QATANCNFSM4VWWYYFA>
.
|
ターミナルで |
@hogehoge-satosato @kyamashiro |
お正月の忙しい時期にご対応いただきありがとうございました😊
心から感謝しております。
とてもいい本だと思うので、より多くの方々に読んで欲しいと願っています。
次の本も楽しみにしております。
2021年1月11日(月) 22:45 Takagi Kensuke <[email protected]>:
… @hogehoge-satosato <https://github.com/hogehoge-satosato>
ご連絡ありがとうございます
確認が遅くなってすみません
いただいた情報は編集に連絡して正誤表に載せてもらいます
@kyamashiro <https://github.com/kyamashiro>
フォローありがとうございます
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#72 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASBVXRQEMYHWU7DVLQP77UDSZL6HFANCNFSM4VWWYYFA>
.
|
こんにちは、React Nativeの本の読者です。
P544~545をコードにしているのですが、UUIDがうまくいかず、タイトルのエラーが出ます。
Jestによるテストが進まず、困っています。
色々調べてためしたのですが、うまくいきません。
https://stackoverflow.com/questions/64165922/error-cannot-read-property-getrandombase64-of-undefined-when-running-test-file
↑ を試しましたが、だめでした。
こちらのGitHubに提供されているコードを丸コピーして入れてもうまくいきませんでした。
アプリの実相のこれまでのところは、うまくいっていました。
こちらはかなりの初心者です。
八方ふさがりで困っています。
心苦しいのですが、ご助言いただけますと助かります。
環境は、Windows10HOME
エディタは、VSCodeです。
よろしくお願いします。
The text was updated successfully, but these errors were encountered: