Comments (3)
@breml good question.
gopherjs test
uses the Node environment; hence the window
global is not available.
For this reason I wrote (the very basic) myitcv.io/gjbt
which enables you to run tests within a headless Chrome instance.
The myitcv.io/react
tests themselves use this approach.
Skeleton tests for all of the generated elements are themselves also generated in case you need any inspiration, e.g. the <a>
element tests.
Let me know how you get on.
from react.
@myitcv I tried gjbt
, but this does not yet look clean to me.
I installed chromedriver
, added the init_test.go
file as suggested and run gjbt .
. I then get this output:
ok github.com/breml/reacttest/test 0.046s
panic: failed to retrieve logs: unexpected response: {"sessionId":"a6fa970438e2285d182fe582c707e7a2","status":6,"value":{"message":"no such session\n (Driver info: chromedriver=2.9.248304,platform=Linux 4.4.0-122-generic x86_64)"}}
goroutine 1 [running]:
main.main()
/home/lubr/code/go/src/github.com/myitcv/gjbt/main.go:163 +0xe8b
It looks like the test have been executed (and are successful), but I still get the above mentioned panic. Do you have an idea why this happens?
from react.
@breml there have been a few more commits recently to gjbt
(as well as some improve documentation) which probably fix the issue you've seen. Please can you give it another try?
In particular, the README now lists requirements:
https://github.com/myitcv/gjbt
from react.
Related Issues (20)
- More CSS Types/Styles HOT 4
- Feature Request HOT 1
- Define aria-* attributes HOT 1
- Make go modules-compatible and switch to mono-repo HOT 18
- reactGen produces illegal code if element name starts with `v` HOT 1
- react.go line 71 conflicts with naming on HTML5 element `<s>` HOT 2
- Unable to use Props and States with maps and slices HOT 3
- jsx.HTML silently fails to render valid input HOT 2
- Issue serving the HelloWorld page built by ReactGen (Windows 8.1 Command Prompt) HOT 3
- can not use input type="text" HOT 1
- Any suggestion import external react component?
- Form OnSubmit not mapped in FormProps
- ReactGen crash when judge HasEquals HOT 1
- StateGen store date conflict HOT 4
- State changes
- go get not working HOT 5
- Feature Suggestion: reactGen -init materializecss
- chrome react extension HOT 1
- how to import packages from npm
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react.