Giter Site home page Giter Site logo

Comments (5)

brainysmurf avatar brainysmurf commented on July 28, 2024

Hmmm. Not able to reproduce. I ran the same code in the IDE and got the expected result:

true
A unit test
✔ will fail with a bad structure

from utgs.

bennettscience avatar bennettscience commented on July 28, 2024

Weird. Here's my stack trace. Using v4 of the published library.

A unit test
	✘ will fail with a bad structure -> Error: Comment: 
	 ---> Error message: Expected thrown error to be of type Error
    
    at new UtgsUnit.Failure (Bundle:566:9)
    at Object.UtgsUnit.assert (Bundle:533:11)
    at Function.throws (Bundle:1112:16)
    at Function.throwsError (Bundle:1153:27)
    at ContextManager.with (Bundle:143:21)
    at Function.it (Bundle:1267:13)
    at it (Bundle:1300:23)
    at ContextManager.with (Bundle:143:21)
    at Function.describe (Bundle:1239:13)
    at describe (Bundle:1297:23)

from utgs.

brainysmurf avatar brainysmurf commented on July 28, 2024

Okay, I think I may know what's happening. Say a library or your main project creates an error object, but another library (utgs) checks to see if it's an instance of it, it'll be false because of a kind of a huge boundary between the two.

I've seen this happen in another context, the fix was to provide the library with the class variable itself.

I've sent an email giving you ability to set library version to head, can you please see if the following code now passes?:

assert.throwsError(comment, function () {
   new MyClass(...);
}, {instanceOf: Error});

from utgs.

bennettscience avatar bennettscience commented on July 28, 2024

Ah, that makes sense.

Switching to HEAD works with that snippet.

from utgs.

brainysmurf avatar brainysmurf commented on July 28, 2024

Awesome, I'll update the api to use that method instead.

from utgs.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.