Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

'it' is not defined #2236

Unanswered
bsastregx asked this question in General
Discussion options

Greetings all,

I am trying to run a test using web-test-runner. I am following the steps from this documentation: https://modern-web.dev/guides/test-runner/getting-started/

The documentation instructs to install the necessary packages:
npm i --save-dev @web/test-runner @esm-bundle/chai

Then writting the test with the required imports:

import { expect } from '@esm-bundle/chai';
import { sum } from '../src/sum.js';
it('sums up 2 numbers', () => {
 expect(sum(1, 1)).to.equal(2);
 expect(sum(3, 12)).to.equal(15);
});

Now, I am getting a warning, that 'it' is not defined:
'it' is not defined.

Of course is not, since I didn't import it.

  • Where should I import this function from?
  • Why does the documentation gives a code example that uses a function that is not installed/included? This causes confusion.

Thanks in advance!

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /