Comments (1)
One of the ways I recently used the expect
method in a UnitTest
:
func test_to_movespeed():
# Test the player's movespeed at level 10:
level = 10
power = PowerConverter.power_gained_at(level)
expected = 165.0
found = base_movespeed + PowerConverter.to_movespeed(power)
expect(expected, found, "movespeed at lvl %s"%level, -1, TestUtils.float_equals)
This shows how I used a method provided by TestUtils
as my comparator.
from simple-testing-godot.
Related Issues (20)
- Remove `src` param from `istrue` and `error_happens` methods HOT 1
- TestUtils needs to be annotated with `@tool` HOT 1
- User code not testable without `@tool` HOT 2
- Update README to include note about adding `@tool` to user autoloads HOT 2
- Jump to code when clicking on errors, tests or scripts in the dock
- Change project root to be the current `res://addons/simple testing` dir
- Display `istrue` and `error_happens` usages even when assertions are successful
- Make error messages optional
- Change `SimpleError` structure HOT 1
- New testing method `expect(expected, found, msg="")`
- Link to plugin in README
- Run tests in play mode
- Dock output copy-paste
- Ensure all classes override built-in `_to_string` method
- Enable or disable testing for any directory, unit test, or `test_` method in dock
- Enexpected bug HOT 1
- UML Diagrams branch
- Fix bug where `error_happens` doesn't work if more than one error occurred HOT 1
- Play mode tests doesn't fail when errors are generated by scripts outside of the PlayModeTest script HOT 1
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 simple-testing-godot.