Git Product home page Git Product logo

es6-mocha-snippets-vs-code's People

Contributors

davidbabel avatar malev avatar spoonscen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

es6-mocha-snippets-vs-code's Issues

Make semicolons optional

Is there anyway to instruct this extension not to insert semicolons in TypeScript? We don't use them and deleting semicolons each time a mocha snippet is unwrapped is PITA.

Extension failing on initial install

Seems like the extension is failing on initial install. It is missing node modules for some reason.

workaround

cd ~/.vscode/extensions/spoonscen.es6-mocha-snippets-0.2.0
npm i

adding file scope (or glob pattern)

Currently, the mocha snippet is enabled for every js (or ts) files globally.

However, it would be better when it is activated only in specified file scopes. (e.g. **/*.test.js)

Extension contains copy of VS Code for macOS

Hi there 👋 VS Code dev here

I just downloaded your extension's VSIX file. It is currently 100 MB large. 💣

You seem to be shipping a copy of VS Code for macOS in the .vscode-test folder. Please refer to our docs so you can ignore this folder from being shipped in your extension.

Add License

Great extension! Could you add a license?

arrow functions aren't recommended

Hi,

Great work on this extension. However, I'm a little concerned it's promoting a problematic style: using arrow functions as callbacks to describe, it, and hooks is discouraged.

Each of these callback functions runs with a context, and if you use an arrow function, you can't use the context. For example, this works:

it('should take a little while', function () {
  this.timeout(2000);
  // do something in under 2 seconds
}); 

...but this doesn't, because there's no this:

it('should take a little while', () => {
  this.timeout(2000); // exception is thrown
}); 

Using arrow functions means if you do ever need the context object, then it becomes more tedious to refactor. This is why it's discouraged.

I understand some people still prefer to write their tests this way (perhaps you included). Maybe you'd consider a adding a warning to the README? You can link to the documentation.

"mocha-snippets.semicolons"

Hi,

Thanks for the great extension!

in the documentation you suggest to use "mocha-snippets.semicolons": boolean which results in Unknown configuration setting error in VSCode. However if you use "mocha-snippets.semicolon": boolean (without the 's' in the end) then all is good. is it possible to fix the documentation?

Mocha discourages use of arrow functions

I think it's important to allow non-arrow callbacks to be used for the snippet expansions… and to make this the default expansion style, as Mocha itself discourages their use:

Passing arrow functions (“lambdas”) to Mocha is discouraged. Due to the lexical binding of this, such functions are unable to access the Mocha context.

Extension not working on VSCode 1.37.1

Hey there,

I noticed this extension hasn't been working at since I upgrade to 1.37.1 of VS Code. (It may have been broken as well in 1.37).

Is this a problem other people are experiencing as well or is it just my setup?

Happy to capture any logs that you may need to confirm a problem.

Support suite/test names

Would be awesome to have snippets for the tdd syntax as well! (suite, test, setup, teardown, etc)

support configurable quote characters

Thanks so much creating this package; it's very handy!

Our code style requires " in JavaScript by default rather than ', so it would be wonderful if this were configurable.

Don't ship .vscode-test

Looking at extension sizes, I see that this extension ships all of vscode inside the .vscode-test folder. You should use a .vscodeignore file to omit that directory.

image

Consider changing snippet prefixes

In my experience, many of the prefixes this package is using become problematic when you're editing a non-empty Mocha file, due to the way VS Code seems to prefer matching existing symbols in its current files over matching snippet prefixes.

For example, open (or quickly create) a mocha test script with at least one it block, and then attempt to use the it() snippet in this package: you'll note that if you simply type it and then hit TAB or ENTER, the editor will fail to place the snippet. I am able to force it by resorting to tapping the arrow keys (in my configuration, I can hit the down arrow once and I'm in business), but this undermines the whole point of using snippets.

One way to address this is by using prefixes which do not collide with any of their expanded snippet text (for example, replacing it with mit, for Mocha::it().

Option to include types in typescript snippet

I am using typescript and when I expand a snippet my linter complains that the functions in it do not have a type. They just need to be it('should have type', function(): void {})
How can I change this?

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.