Giter Site home page Giter Site logo

Location of "requires" about mocha-sidebar HOT 6 OPEN

maty21 avatar maty21 commented on August 30, 2024 1
Location of "requires"

from mocha-sidebar.

Comments (6)

maty21 avatar maty21 commented on August 30, 2024

Hi did you tried exactly what was written in the q&a section in the readme file
There is specific section about using Typescript
Try it and if it not works for you tell me tks

from mocha-sidebar.

rosesonfire avatar rosesonfire commented on August 30, 2024

I have run into the same problem as well. I do not use typescript, I use just javascript. The problem I faced was: whatever was mentioned in the mocha.requires part was loaded from the node_modules and not the project root.

Please note: when mocha is run with command line with the --require switch, it works.

from mocha-sidebar.

tomitrescak avatar tomitrescak commented on August 30, 2024

@maty21 the typescript bit has nothing to do with this problem ... its the path resolution for require that seems to be fishy :/

from mocha-sidebar.

yehiyam avatar yehiyam commented on August 30, 2024

fix published in version 0.13.0 of the extension. @tomitrescak could you verify that it works now?

from mocha-sidebar.

tomitrescak avatar tomitrescak commented on August 30, 2024

Hi, thanks for the fix. Not sure what is wrong, but I still can't make this work:

The are my options:

{
"mocha.env": {
		"TS_NODE_FAST": "true"
	},
	"mocha.options": {
		"grep": "@server",
		"invert": "",
		"exit": "",
		"ui": "snapshots"
	},
	"mocha.files.glob": "src/**/*.test.ts*",
	"mocha.files.ignore": [
		"**/.git/**/*",
		"**/node_modules/**/*"
	],
	"mocha.runTestsOnSave":  "true",
	"mocha.requires": ["./mocha.js"]
}

This is the output:

Running Mocha with Node.js at "/usr/local/bin/node"

Applying Mocha options:
  {
    "grep": "@server",
    "invert": "",
    "exit": "",
    "ui": "snapshots"
  }

It never finishes.

And if you wonder what is in that required mocha.js file it's this:

// setup ts compilation
require('ts-node/register');

// setup mocha
require('chai-match-snapshot/mocha').setupMocha();

// setup snapshot testing with mocha
require('wafl').setup({
  snapshotMode: process.env.US ? 'drive' : 'test'
});

from mocha-sidebar.

yehiyam avatar yehiyam commented on August 30, 2024

I'll take a look

from mocha-sidebar.

Related Issues (20)

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.