You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be awesome to add the new web testing stuff into the cookiecutter! The most important things to include are TestRunner.html, run_tests.sh, and a testing file stub.
A testing file stub could look a lot like this:
#include "../third-party/Empirical/source/web/Document.h"
#include "../third-party/Empirical/source/web/_MochaTestRunner.h"
struct ExampleTest : emp::web::BaseTest {
int testValue;
ExampleTest() { Setup(); }
void Setup() {
testValue = 2;
}
void Describe() override {
EM_ASM({
const testValue = $0;
describe("an example test", function() {
it("should pass in a test value correctly", function() {
chai.assert.equal(testValue, 2);
});
});
}, testValue);
}
};
emp::web::MochaTestRunner test_runner;
int main() {
emp::Initialize();
test_runner.AddTest<ExampleTest>("ExampleTest");
test_runner.Run();
}
The text was updated successfully, but these errors were encountered:
It would be awesome to add the new web testing stuff into the cookiecutter! The most important things to include are
TestRunner.html
,run_tests.sh
, and a testing file stub.A testing file stub could look a lot like this:
The text was updated successfully, but these errors were encountered: