ict.ken.be

Delivering solid user friendly software solutions since the dawn of time.

No EditorOptionDefinition Export Found Error 

Categories: Visual Studio

I had this error after I crashed a nodejs tools process in visual studio 2013. Apparently removing the component cache folder fixed it.

  • Close visual studio instances
  • Open the folder: %LocalAppData%\Microsoft\VisualStudio\12.0\
  • Delete ComponentModelCache folder
  • Start visual studio

This fixed the "No EditorOptionDefinition Export Found" error

nodejs-for-visual-studio 

Categories: Nodejs Visual Studio

Nodejs tools for visual studio

Nodejs interactive window

  • ctrl-K, N
  • .npm -v

Nodejs location in vs 2015

  • Tools > Options > Projects & Solutions > External Web Tools

Nodejs max path issues (solved from v5)

  • npm install npm-windows-upgrade -g && npm-windows-upgrade --npm-path "c:\tools\vendor\nodejs"
  • npm install rimraf -g
  • npm dedupe
  • npm install flatten-packages -g (might give version conflicts)

More

npm 

Categories: Nodejs

https://www.npmjs.com/

  • node -v (higher v0.10.32)
  • npm install npm -g
  • npm -v
  • npm root -g
  • npm bin -g
  • npm set init.author.name "ken"
  • npm set init.license "MIT"
  • npm init --yes
  • npm install <package_name> --save-dev
  • npm outdated
  • npm update
  • dir node_modules/.bin
  • npm run
  • npm run-script test
  • npm run test
  • npm t -s
  • npm start
  • npm stop
  • npm restart
  • npm install mocha chai --save-dev
  • npm version patch
  • npm config set mypkgname:myvar myvalue
  • npm install http-server -g  && http-server .
  • npm install -g nodemon && nodemon app.js

package.json

{
    "name": "one-word-preferred-with-dashes-and-lowercase",
    "version": "1.0.0",
    "description" : "Some blabla",
    "keywords" : [
        "npm",
        "blabla"
    ],
    "author": "Ken Van Gilbergen",
    "license": "MIT",
    "scripts": {
        "lint": "jshint *.js **/*.js",
        "watch:lint": "watch 'npm run lint' .",
        "pretest": "npm run lint",
        "test": "mocha test -u bdd -R spec",
        "posttest": "echo 'after test'",
        "watch:test": "npm run test -- -w -R min",
        "start": "node index.js",
        "stop": "echo \"really"\" && echo \"stop"\"",
        "custom": "echo 'custom'; echo 'run independent of custom'",
        "parallel": "npm run first & npm run linux",
        "parallel": "START /b 'npm run first';START /b 'npm run windows'",
        "vars": "foo $npm_package_config_myvar" 
    },
    "repository": {
        "type": "git",
        "url": "."
    },
    "engines": {
        "node": "~1.1.1",
        "npm": "~1.1.1"     
    },
    "config": {
        "myvar": "whatever"
    }
}

Wallaby 

Categories: Testing

It's like NCrunch but for javascript.

http://wallabyjs.com/

JS Testing History

  • console
  • browser running tests
  • commandline with test watcher (needs stack copy)
  • resharper running tests (needs reference paths)
  • wallaby coverage and running tests

Wallaby

  • install through extensions
  • add wallaby.json to your solution

wallaby.json

{
  "files": [
    { "pattern" : "test/lib/chai.js", "instrument": false },
    "src/*.js"
    ],
    "tests": [
        "test/*Tests.js",
        "test/*Tests.ts",
        "test/*Tests.coffee"
    ],
    "testFramework": "mocha"
}
  • default test framework is jasmine
  • to exclude from coverage set instrument to false
  • right-click wallaby.json and select start
  • restart wallaby if you update the wallaby.json
  • yellow means partially covered (click to see what part was not processed)
  • screenshot of last runned test in context menu

Wallaby Visual Studio Shortcut Keys

  • Start Wallaby: alt-w alt-1
  • Stop Wallaby: alt-w alt-2
  • Restart Wallaby: alt-w alt-3
  • Run all tests: alt-w alt-4
  • Jump to failing test: alt-w alt-5
  • Context Menu: alt-shift-f10

Advanced

wallaby.js

var babel = require("babel");

module.exports = function (wallaby) {
    return {
        "files": [
            { "pattern": "test/lib/*.js", "instrument": false },
            "src/*.js"
        ],
        "tests": [
            "test/*Tests.js"
        ],
        "delays": {
            edit: 700,
            run: 300
        },
        "debug": true,
        "compilers": {
            "**/*.js": wallaby.compilers.babel  (
                {
                    babel: babel,
                    stage: 0
                }
            )
        },
        "env": {
            type: "node"
        }
    };
}

More

Page 5 of 40 << < 1 2 3 4 5 6 7 8 9 10 20 > >>