-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
automated unit tests #997
Comments
So besides having the hipsterish name and advertising a dependence inducing beverage, Mocha uses a hexagon in the logo. Ancient Beast has a lot of hexagons on the combat field. Coincidence? Don't think so. |
Based on that requirement, I suggest using https://github.com/chaijs/chai as the assertion library, since it also has a hexagonal logo 👌 |
Good suggestion, it will do the job. Seems they're using gitter too xD |
So I found myself down a very deep rabbit hole and could go no further. The big problem is that Phaser is not meant to be run outside the browser, unlike the unit tests, which are run inside node. Unfortunately the current codebase is tightly coupled around Phaser, namely via the There's like one guy who tried to get Phaser working in node. It works for a specific version (2.2.2 I think) and requires some hacking because Phaser works closely with the DOM, like So that's the bad news; good news is that regular unit tests work fine, and I manage to remove prototype.js without too much drama. If you're still interested, then moving forward we can slowly decouple
But we'll also need
|
Sounds good, you can proceed. I'm looking into browserify vs webpack atm. Regarding Babel, I don't really care about Internet Explorer, so if it brings anything really useful to the table besides that without being too much of a pain, then perhaps. |
Sure; if we avoid babel we can try to use minimal ES6, which means right now we only care about this: https://kangax.github.io/compat-table/es6/#test-class |
Did research regarding browserify vs webpack. Seems that the later one is doing better and it also has hexagonal logo :D and gitter chat room. Always found browserify kinda confusing and doing certain things badly. There's also systemjs / JSPM, but meh. ES6 sounds good. The main browser is Google Chrome, second class citizen is Firefox. So unless a browser is popular enough and a rather easy pick, won't go out of the way of supporting it. For all the people insisting on using any sort of irrelevant or strange browsers, there will be downloadable version of the game eventually #158. Regarding Ancient Beast website (even if rather underground), the visitor statistics are (even if probably very flawed) the following:
Anyway, Chrome and Analytics being both Google products, the stats might as well be tampered with xD |
I've spent another week attempting to get webpack to deploy the game, and there's still no end in sight, so I want to give up on this issue for now. The problem is that webpack works with the whole node / CommonJS / require() system, which cannot handle circular references, caused by the If we ever want to clean up the code so that it can be modular and testable, we'll need to:
There's one more idea to try though; since the game has the |
I was wondering about your status on this. No worries, it's more important for now to keep things simpler with the pipeline in favor to focus on unit abilities and other stuff to get the release done asap. That selenium sounds good, provided the game will have some sort of random AI to begin #542 , causing all sorts of moves to happen, hopefully revealing interesting scenarios and even bugs #997 |
Here's the work in progress, just FYI: |
Would have been easier to check out if you made another branch just for this issue :) |
Nice related article regarding Riot's League of Legends https://engineering.riotgames.com/news/automated-testing-league-legends (thanks @GamesMaxed for sharing) |
Testing suite, might come in handy https://www.cypress.io |
Any progress on this? Unit tests would be handy for new code. To move the discussion forward, I suggest Jest, simply because it appears to be the most popular testing framework on NPM and has pretty good docs. Maybe we work tests into That said, mocha/chai is fine for unit tests as well. |
No progress on this stuff, sadly, as tests would be handy. Nice suggestions from you, I've peeked at Jest, looks good to me. |
You mentioned you were going to talk to a friend. I don't want to jump the gun; would you accept a PR with Jest or another framework? I've been working on creatureQueue and ids. It'd be really handy to have a testing framework in place. |
I've noticed you poked at it and then you backed out of it, thought because build failed. Feel free to PR it again I guess. |
Great. Will do! Yes, I should have used the "draft" PR button instead. I was having trouble with the automatic linter and TypeScript tests. I think it's ironed out. |
Alright, out of brainstorm as we went with Jest framework. Issue will be closed once we have some unit ability tests in. |
Jest testing framework FreezingMoon#997
Add TS/DOM support for Jest FreezingMoon#997 FreezingMoon#1969
The project will become more and more complex, especially due to all the unit abilities and their upgrades, so we need to perform automated tests in order to figure if most things still work out when something is being changed.
The framework picked is Jest:
https://jestjs.io
https://github.com/facebook/jest
Other candidates that were considered:
https://github.com/chaijs/chai
https://github.com/intuit/karate
https://github.com/jasmine/jasmine
https://github.com/mochajs/mocha
Here are some that foss projects can apply for
https://www.browserstack.com/open-source
https://crossbrowsertesting.com/open-source
The text was updated successfully, but these errors were encountered: