Coder Social home page Coder Social logo

loca's People

Contributors

simov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

loca's Issues

Uncaught Error: write EPIPE

I use this loca with mocha and node-webkit. I found an example (https://github.com/visionmedia/mocha/wiki/Using-mocha-with-node-webkit) how to test web-kit applications with mocha.

config.js

// show the dev tools by default
require('nw.gui').Window.get().showDevTools().resizeTo(800, 1000);

$(function () {
    // programatically
    var Mocha = require('mocha'),
        fs = require('fs'),
        path = require('path');

    // First, you need to instantiate a Mocha instance.
    var mocha = new Mocha;
    mocha.reporter('loca');
    // pass the browser context
    mocha.suite.emit('pre-require', window, null, mocha);

    // Then, append your tests

    // Here is an example:
    fs.readdirSync('test').filter(function (file) {
        // Only keep the .js files
        return file.substr(-3) === '.js';

    }).forEach(function (file) {
        // Instead of using mocha's "addFile"
        $('head').append('<script src="'+path.join('test', file)+'"></script>');
    });

    // Now, you can run the tests.
    mocha.run(function (failures) {
        process.on('exit', function () {
            process.exit(failures);
        });
    });
});

test.js

var assert = require('chai').assert;

describe('Functions', function(){
  describe('myFunction', function(){
    it('should return vale one multiplied by value two', function(){
      assert.equal(1, myFunction(1, 1));
      assert.equal(64, myFunction(8, 8));
    })
  })
})

If I run this, the tests will run but loca will cause the error Uncaught Error: write EPIPE

Functions C:\Users\Liebig\AppData\Local\Temp\nw8764_9618\node_modules\loca\webkit.js:49
Uncaught Error: write EPIPE events.js:82
myFunction C:\Users\Liebig\AppData\Local\Temp\nw8764_9618\node_modules\loca\webkit.js:49
โœ“ should return vale one multiplied by value two C:\Users\Liebig\AppData\Local\Temp\nw8764_9618\node_modules\loca\webkit.js:63
duration: 26.000ms C:\Users\Liebig\AppData\Local\Temp\nw8764_9618\node_modules\loca\webkit.js:83
1 passing C:\Users\Liebig\AppData\Local\Temp\nw8764_9618\node_modules\loca\webkit.js:86

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.