Code Monkey home page Code Monkey logo

jest-environment-obsidian's People

Contributors

eth-p avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

jest-environment-obsidian's Issues

[Other]: Module jest-environment-obsidian should have "jest-preset.js" or "jest-preset.json" file at the root.

Affected Version

0.0.1

Info

Description

After installing, when attempting to run a test via npm run test, I received the following error:

● Validation Error:

  Module jest-environment-obsidian should have "jest-preset.js" or "jest-preset.json" file at the root.

  Configuration Documentation:
  https://jestjs.io/docs/configuration

Environment

OS: Windows 10
Node: 18.16.1
Jest: 29.6.1

Steps to Reproduce

  1. Install jest-environment-obsidian via npm install --save-dev jest-environment-obsidian
  2. Change preset in jest.config.cjs to 'jest-environment-obsidian'
  3. Run test via npm run test

Workaround

I was able to clear this error by copying node_modules/jest-environment-obsidian/dist/jest-preset.js to node_modules/jest-environment-obsidian/.

[Other]: Cannot find module '../node_modules/jest-message-util/build/index.js'

Affected Version

0.0.1

Info

The issue appears to be due to the way that the path to node_modules/jest-message-util/build/index.js is constructed in src/warning.ts.

Description

After successfully implementing workaround for #2, when attempting to run a test via npm run test, I received the following error:

 FAIL  test/settings.test.ts
  ● Test suite failed to run

    Cannot find module '../node_modules/jest-message-util/build/index.js'
    Require stack:
    - %project_root%\node_modules\jest-environment-obsidian\dist\jest-environment.js
    - %project_root%\node_modules\jest-util\build\requireOrImportModule.js
    - %project_root%\node_modules\jest-util\build\index.js
    - %project_root%\node_modules\jest-config\build\getCacheDirectory.js
    - %project_root%\node_modules\jest-config\build\Defaults.js
    - %project_root%\node_modules\jest-config\build\normalize.js
    - %project_root%\node_modules\jest-config\build\index.js
    - %project_root%\node_modules\jest-cli\build\init\index.js
    - %project_root%\node_modules\jest-cli\build\run.js
    - %project_root%\node_modules\jest-cli\build\index.js
    - %project_root%\node_modules\jest-cli\bin\jest.js
    - %project_root%\node_modules\jest\bin\jest.js

      at Object.<anonymous> (node_modules/jest-environment-obsidian/dist/jest-environment.js:132:32)
      at Object.newLoader (node_modules/pirates/lib/index.js:121:7)

(path to project root truncated for readability)

Environment

OS: Windows 10
Node: 18.16.1
Jest: 29.6.1

Steps to Reproduce

  1. Install jest-environment-obsidian via npm install --save-dev jest-environment-obsidian
  2. Change preset in jest.config.cjs to 'jest-environment-obsidian'
  3. Implement jest-preset.js workaround from issue #2
  4. Run test via npm run test

Workaround

I was able to clear this error by changing line 132 in dist/jest-environment.js to the following:

var import_jest_message_util = require("../../../node_modules/jest-message-util/build/index.js");

This causes it to go up two more directory levels before attempting to traverse node_modules/, which allows it to successfully find jest-message-util/build/index.js.

Extract shims into separate package

The shims under src/runtime could potentially be used with other testing frameworks (vitest, bun test, etc.).

I understand there is some Jest-specific logic in some of those files. But if those could be removed or replaced with some sort of dependency injection, then I think it could be really beneficial to extract these shims into their own package.

[Needs Stub]: PluginSettingTab

Affected Version

0.0.1

Affected Modules

obsidian

Info

This is blocking my test suite from running, even though the single test I have so far in my suite isn't touching PluginSettingTab at all.

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.