Skip to content

Migrating to Chai 5.0 in browser #1600

Answered by 43081j
schrotie asked this question in Support
Discussion options

You must be logged in to vote

you are right, we need to update the docs (actually there's a few places we really should update asap before more people get confused)

basically, moving it to an ES module means we don't expose it on a global anymore automatically

so you would need to register one of the interfaces:

import '../node_modules/chai/register-should.js';
// or
import '../node_modules/chai/register-assert.js';

or alternatively do what you said, import chai within your JS (import {chai})

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by schrotie
Comment options

You must be logged in to vote
1 reply
@43081j
Comment options

Comment options

You must be logged in to vote
1 reply
@43081j
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1599 on February 02, 2024 16:59.