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

[Internals] Broken unit test when running test:unit #4261

Closed
himynameisdave opened this issue Jan 14, 2020 · 1 comment · Fixed by #4262
Closed

[Internals] Broken unit test when running test:unit #4261

himynameisdave opened this issue Jan 14, 2020 · 1 comment · Fixed by #4262

Comments

@himynameisdave
Copy link
Contributor

Describe the bug
Running the unit tests locally will fail when run (npm run test:unit). Specifically this test will fail.

Logs

> [email protected] test:unit /Users/fossaloaner1/GitHub/svelte
> mocha --require sucrase/register --recursive src/**/__test__.ts

  get_name_from_filename
    ✓ uses the basename
    ✓ uses the directory name, if basename is index
    1) handles unusual filenames


  2 passing (5ms)
  1 failing

  1) get_name_from_filename
       handles unusual filenames:

      AssertionError [ERR_ASSERTION]: 'U5B_partsu5D' == 'Parts'
      + expected - actual

      -U5B_partsu5D
      +Parts

      at Context.<anonymous> (src/compiler/compile/utils/__test__.ts:14:10)
      at processImmediate (internal/timers.js:439:21)

To Reproduce

Do this:

git clone [email protected]:sveltejs/svelte.git
cd svelte/
npm install
npm run test:unit

Expected behavior
The test should pass, or be removed. We should also investigate when this broke.

Information about your Svelte project:
Cloned this project, at commit 3d9655a.

Severity
These tests don't seem to get run anywhere (aside from locally as developers), so I'd rate this as pretty low priority. I already have a fix on the way 👍

Additional context
Noticed this while I was working on #3311 and I just wanted to document this here so I have something to attach a PR to.

I was also curious why these unit tests aren't run anywhere. 🤔

@himynameisdave
Copy link
Contributor Author

Introduced here I think #3862

Unclear if this was ever working though, seems broken in the REPL as well.

My plan is to just remove this test for the time being, unless this was expected functionality.

@himynameisdave himynameisdave changed the title Broken unit test when running test:unit [Internals] Broken unit test when running test:unit Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants