Coder Social home page Coder Social logo

Comments (4)

bmeck avatar bmeck commented on June 12, 2024

Its a logic error w/ our regexp, going to have to use manual things to do length matching. Current implementation will only handle one backspace at a time. Fixing.

from prompt.

indexzero avatar indexzero commented on June 12, 2024

Tests are now passing, but I am seeing an EventEmitter leak when running vows --spec now:

$ vows --spec

♢ prompt

info:   These node-prompt tests are interactive
info:   Not following instructions will result in test failure
info:   When prompted, enter: 12345 [backspace] [backspace] [enter]
prompt: password: 
  When using prompt the getInput() method when passed a complex property with hidden: true
    ✓ should respond with 123

♢ prompt

prompt: foo: prompt: test input: prompt: password: prompt: password: prompt: username: prompt: username: prompt: bad-validator: prompt: test input: prompt: riffwabbles (foobizzles): (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace: 
    at ReadStream.<anonymous> (events.js:126:17)
    at /Users/Charlie/Nodejitsu/node-prompt/lib/prompt.js:341:9
    at EventEmitter.getInput (/Users/Charlie/Nodejitsu/node-prompt/lib/prompt.js:213:8)
    at get (/Users/Charlie/Nodejitsu/node-prompt/lib/prompt.js:164:12)
    at /Users/Charlie/Nodejitsu/node-prompt/node_modules/async/lib/async.js:118:13
    at Object.forEachSeries (/Users/Charlie/Nodejitsu/node-prompt/node_modules/async/lib/async.js:134:9)
    at EventEmitter.get (/Users/Charlie/Nodejitsu/node-prompt/lib/prompt.js:175:9)
    at Object.<anonymous> (/Users/Charlie/Nodejitsu/node-prompt/test/prompt-test.js:199:22)
    at run (/Users/Charlie/Nodejitsu/node-prompt/node_modules/vows/lib/vows/suite.js:130:31)
    at EventEmitter.<anonymous> (/Users/Charlie/Nodejitsu/node-prompt/node_modules/vows/lib/vows/suite.js:203:40)
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace: 
    at ReadStream.<anonymous> (events.js:126:17)
    at /Users/Charlie/Nodejitsu/node-prompt/lib/prompt.js:342:9
    at EventEmitter.getInput (/Users/Charlie/Nodejitsu/node-prompt/lib/prompt.js:213:8)
    at get (/Users/Charlie/Nodejitsu/node-prompt/lib/prompt.js:164:12)
    at /Users/Charlie/Nodejitsu/node-prompt/node_modules/async/lib/async.js:118:13
    at Object.forEachSeries (/Users/Charlie/Nodejitsu/node-prompt/node_modules/async/lib/async.js:134:9)
    at EventEmitter.get (/Users/Charlie/Nodejitsu/node-prompt/lib/prompt.js:175:9)
    at Object.<anonymous> (/Users/Charlie/Nodejitsu/node-prompt/test/prompt-test.js:199:22)
    at run (/Users/Charlie/Nodejitsu/node-prompt/node_modules/vows/lib/vows/suite.js:130:31)
    at EventEmitter.<anonymous> (/Users/Charlie/Nodejitsu/node-prompt/node_modules/vows/lib/vows/suite.js:203:40)


✗ Errored » callback not fired
    in When using prompt the readLine() method
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the readLineHidden() method
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the addProperties() method
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the getInput() method with a simple string prompt
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the getInput() method with a hidden field that is not supposed to be empty and we provide valid input
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the getInput() method with a hidden field that is not supposed to be empty and we don't provide an input
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the getInput() method with a complex property prompt and a valid input
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the getInput() method with a complex property prompt and an invalid input
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the getInput() method with a complex property prompt with an invalid validator (array)
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the get() method with a simple string prompt that is not a property in prompt.properties
    in prompt
    in test/prompt-test.js
✗ Errored » callback not fired
    in When using prompt the get() method with a simple string prompt that is a property name in prompt.properties with a default value
    in prompt
    in test/prompt-test.js
✗ Errored » 1 honored ∙ 1 errored ∙ 11 dropped

from prompt.

indexzero avatar indexzero commented on June 12, 2024

Wait, I think this might be my fault. Hold on

from prompt.

indexzero avatar indexzero commented on June 12, 2024

This was an error in the tests. The event emitter "leak" was not a leak at all. The mock tests were not correctly setting the mock stdin stream so .readLine was called multiple times in parallel thus appearing as if it was a leak.

from prompt.

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.