以下后设立排毒的基本指令为我简单的示例项目,并运行一个成功的detox build,detox test产生下面的输出,即使只测试配置我有我的package.json是iOS版:
{
"name": "Learn",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.4.1",
"react-native": "0.56.0"
},
"devDependencies": {
"babel-jest": "23.4.0",
"babel-preset-react-native": "5.0.2",
"detox": "^8.0.0",
"jest": "^23.4.1",
"react-test-renderer": "16.4.1"
},
"jest": {
"preset": "react-native"
},
"detox": {
"configurations": {
"ios.sim.debug": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/Learn.app",
"build": "xcodebuild -project ios/Learn.xcodeproj -scheme Learn -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
"type": "ios.simulator",
"name": "iPhone 6"
}
},
"test-runner": …Run Code Online (Sandbox Code Playgroud) 喜欢这个正则表达式吗?它匹配什么?
document.getElementById("MyElement").className =
document.getElementById("MyElement").className.replace
( /(?:^|\s)MyClass(?!\S)/ , '' )
Run Code Online (Sandbox Code Playgroud)