• Preparing search index...
  • The search index is not available
Legend Studio API Documentation
  • Legend Studio API Documentation
  • @finos/legend-vscode-extension-dependencies
  • assertErrorThrown

Function assertErrorThrown

  • assertErrorThrown(error: unknown): asserts error is Error

    This is a relatively crude way to handle error of type unknown thrown for now. We should revisit this when Typescript supports throws clause See https://github.com/microsoft/TypeScript/issues/13219

    NOTE: There's a problem with this check in JSDOM leading so we have to disable this in test environment JSDOM uses their own isolated object rather than native object for performance purpose See https://github.com/jsdom/jsdom/issues/3082 For example, TypeErrors generated by webidl2js or whatwg-url used by jsdom, or manually-thrown ones inside impl classes, are thrown using global.TypeError, not dom.window.TypeError. This change is hard to implement as of now See https://github.com/jsdom/jsdom/issues/2727 See https://github.com/facebook/jest/issues/2549

    Read more related discussions at: https://github.com/jsdom/jsdom/issues/1737 https://github.com/webcomponents/polyfills/issues/105 https://github.com/jsdom/jsdom/issues/1769 https://github.com/jsdom/jsdom/issues/2555

    Parameters

    • error: unknown

    Returns asserts error is Error

    • Defined in packages/legend-shared/lib/error/ErrorUtils.d.ts:72

Settings

Member Visibility
Legend Studio API Documentation
  • Loading...