Skip to content
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

Testing Tutorial #16

Open
JhonSmithRomeroSolorzano opened this issue Apr 2, 2021 · 4 comments
Open

Testing Tutorial #16

JhonSmithRomeroSolorzano opened this issue Apr 2, 2021 · 4 comments

Comments

@JhonSmithRomeroSolorzano

Hi every body.

I'm doing the testing tutorial, wich is in https://mithril.js.org/testing.html

I did each step exactly as suggested, with the suggested file structure, but I'm geeting this result.

Result

There is no error but the component was not tested either.

Code

component-test
component
setup
pakage

I want to know what I am skipping, or what step does not have the tutorial that I am skipping.
I really appreciate the help you can give me since I have to start testing my application.

@osban
Copy link
Contributor

osban commented Apr 3, 2021

@JhonSmithRomeroSolorzano I can confirm it doesn't work out of the box. I don't have the time today to figure out why not, but maybe someone else can. I think that out.should.contain("day") doesn't work anymore (it should be something like o(testvalue).equals('expected value') now), but that's not the reason it doesn't work.

@mchampaneri
Copy link

I'm facing same.

@barneycarroll
Copy link
Member

I'm seeing the same stuff, and I can't figure out why. Worth enumerating the other problems with the test documentation:

  1. It doesn't install Mithril
  2. It doesn't bind the Mithril module to global in test-setup.js
  3. It's confused about whether it's using ospec or mocha - step 1 says to add "test": "mocha" to your scripts but then immediately tells you to use ospec instead; later the test file uses ospec test specifications but mocha assertions.

I've tried variations of the command line and nothing seems to work for this setup. Strange!

@mytskine
Copy link

I also struggled with the Mithril documentation for testing. Then I did set up a testing environment for a JS application, using Webpack and Mocha. So I took some time to write a tutorial and a sample application: https://gitlab.com/Mytskine/mithril-real-world. Mocha tests are run locally and with Gitlab-CI. Hope that helps.

@dead-claudia dead-claudia transferred this issue from MithrilJS/mithril.js Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs triage
Development

No branches or pull requests

5 participants