我正在尝试运行react-native start并出现以下错误
"Cannot find module 'metro-core'. Run CLI with --verbose flag for more details.
Run Code Online (Sandbox Code Playgroud)
在收到此消息之前,我收到了一条不同的错误消息,指出未找到模块,因此我尝试了以下操作:
删除node_modules文件夹 -
rm -rf node_modules && npm install
Reset packager cache - rm -fr $TMPDIR/react-* or node_modules/react-native/packager/packager.sh --reset-cache
Clear watchman watches - watchman watch-del-all
Run Code Online (Sandbox Code Playgroud)
我刚刚输入了react-native start,模拟器上就弹出了错误消息,这告诉我在终端上查看错误消息。
我试图循环浏览span标签列表,然后断言视频上显示的所有三个时间戳都是正确的。当我在 Cypress 中运行测试时,出现以下错误:
预计 [] 包括 0:20
在尝试做出第一个断言后它就崩溃了。
我编写的测试可能过于复杂,但我想看看是否有人可以通过查看我的代码并找出问题所在来提供帮助。我编写测试的方法是循环遍历元素列表,将每个值存储在空数组中,然后断言它们。
describe("Asserting timestamps", () => {
beforeEach(() => {
myLoginData
})
it("Asserting the right timestamps are displaying in Video", () => {
displayedTimeStamp = [];
cy.get(".timestamp").each((element) => {
expect(element).to.exist;
cy.wrap(element);
.invoke("text")
.then((element) => {
displayedTimeStamp.push(element[0].innerText);
});
})
expect(displayedTimeStamp).includes("0:20") ||
expect(displayedTimeStamp).includes("0:25") ||
expect(displayedTimeStamp).includes("0:45")
});
});
Run Code Online (Sandbox Code Playgroud)
<div class="video-timestamp-editor"
<div class="video-notes-list"
<div class=video-note-data">
<span class="timestamp">0:20</span>
<span class="video-note-author">Alexander the Great</span>
<span class="note-text">" This is a note "</span>
</div>
<div class=video-note-data">
<span class="timestamp">0:25</span>
<span class="video-note-author">Alexander …Run Code Online (Sandbox Code Playgroud)