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
Im working on FizzBuzz JS. Specs wouldn't pass because of the inner HTML that Chai is picking up (check out screenshots). Specs pass if I use include instead of eql but I wonder if there's a simple way of "telling" Chai to ignore the HTML tags and still perform the eql.
Spec
const{FizzBuzz}=require('../spec.helper.js')describe('Fizz Buzz',()=>{letfizzBuzz=newFizzBuzzit("returns a number if no game rules are met",()=>{expect(fizzBuzz.check(1)).to.eql(1)})it("returns Buzz if number is divisible by 5",()=>{expect(fizzBuzz.check(5)).to.eql("Buzz")})it("returns Fizz if number is divisible by 3",()=>{expect(fizzBuzz.check(3)).to.eql("You entered 3. Fizz!")})it("returns FizzBuzz if number is divisible by 15",()=>{expect(fizzBuzz.check(15)).to.include("FizzBuzz!")})})
Problem
Background
Im working on FizzBuzz JS. Specs wouldn't pass because of the inner HTML that Chai is picking up (check out screenshots). Specs pass if I use
include
instead ofeql
but I wonder if there's a simple way of "telling" Chai to ignore the HTML tags and still perform theeql
.Spec
Implementation code
Screenshots
How did you try to solve the problem?
Tried to turn the whole thing into string:
(didn't work)
Read through Chai docs but didn't find anything useful.
The text was updated successfully, but these errors were encountered: