Giter VIP home page Giter VIP logo

faucet's People

Contributors

ljharb avatar prantlf avatar talmobi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

faucet's Issues

Doesn't work on Windows in git bash (msysgit)

The output of any test in msysgit looks like this:

2015-01-05 14_00_39-console - mingw32__c_users_tomasz_libraries_tomekwi_as js

The original TAP input:

> node test
TAP version 13
# map-to/array
ok 1 should be equivalent
ok 2 should be equivalent
ok 3 should be equivalent
# map-to/object
ok 4 should be equivalent
ok 5 should be equivalent
ok 6 should be equivalent
ok 7 should be equivalent

1..7
# tests 7
# pass  7

# ok

Doesn't report stacktrace on failure

I notice that the tape library outputs the stack when a test fails, but once I pass it through faucet, I can't see the stack. Is there any way to enable that for debugging purposes?

assert out of order

tape -- tests/*.js core/tests/*.js plugins/*/tests/*.js | faucet

gives me not ok <number> assert out of order while this gives

tape -- tests/*.js core/tests/*.js plugins/*/tests/*.js
...
1..115
# tests 115
# pass  115

# ok

faucet command not working on Win10

Getting this error when just using faucet

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\Users\UserName\AppData\Roaming\npm\node_modules\faucet\node_modules\tape\bin\tape ENOENT
    at exports._errnoException (util.js:870:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at nextTickCallbackWith2Args (node.js:442:9)
    at process._tickCallback (node.js:356:17)
    at Function.Module.runMain (module.js:443:11)
    at startup (node.js:139:18)
    at node.js:968:3

Throws on early-terminated pipe

Example:

$ node test/foobar.test.js | faucet | head -n 2
✓ foobar
# tests 1

stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
Error: write EPIPE
    at errnoException (net.js:901:11)
    at Object.afterWrite (net.js:718:19)

Without head:

$ node test/foobar.test.js | faucet
✓ foobar
# tests 1
# pass  1
✓ ok

That's likely because head closes the pipe as soon as it got 2 lines, breaking the pipe on the faucet side.

Support for alternatives to the tape command

I've written an alternative to the tape and would like to be able to use it with faucet. The command is called tapeo. It is presently a fork of tape, but it's written so that it proposes hooks in tape that would allow tapeo to simply be an executable script that uses the tape module.

To use faucet with tapeo or other alternative TAP producers, this is all that's needed:

  • Allow an environment variable to specify the underlying TAP command.
  • Pass command line options (e.g. -n) to the underlying TAP command.

I propose the environment variable FAUCET_TAP_CMD. I'll provide a PR shortly.

less verbose output with option

I would love if there was an option to turn

⨯ doing this and that
  not ok 9 bla should be equivalent
    ---
      operator: deepEqual
      expected: |-
        [  ]
      actual: |-
        [ ... ]
      at: add (bla.js:49:5)
    ...

to just

⨯ doing this and that
  not ok 9 bla should be equivalent

Can't run faucet on windows when installed as a project module

When faucet is installed as a project dependency, it hangs indefinitely when called directly or through some test command.

Example:
node_modules/.bin/faucet produces just an empty and a blinking cursor in git bash. (haven't tried it in other Windows bash adaptations)

Additional info:

  • OS: Windows 8.1 64-bit
  • Node version: v5.0.0
  • npm version: v3.3.6

Does not report skipped tests?

I am piping output from tape 4.2.0 into faucet, I'm not sure if this issue is caused by tape output or by faucet.

According to what appears to be the tap spec, lines like this should count as skipped:

ok 23 # skip Insufficient flogiston pressure.

If the whole test file succeeds, the count of skipped tests is included in the generated output. The harness should report the text after # SKIP\S*\s+ as a reason for skipping.

Tape does not appear to output anything for skipped tests, and skipped assertions have # SKIP appended to the message rather than prepended.

faucet does not display tests that have skipped assertions any differently, even if I edit the output to make the skipped test lines look like the one in the spec (move # skip to just after the assertion number) and has nothing in the final lines about skipped tests.

Long descriptions break output

With this test ...

var test = require('tape');

test('long description', function(t) {
  t.equal(0, 0, "this is a very long description this is a very long description this is a very long description")
  t.end()
});

... my output looks like this:

# long description
✓ long descriptionery long description this is a very long description this is a very long descripti# tests 1
# pass  1
✓ ok

I notice that if I delete the last two characters, making it a 93 character long description, the weird printing doesn't happen. Same goes for a description that is just a lot of a: up to 93 works; over 93 causes this weirdness.

Colon in test description corrupts output formatting

"tape": "^4.6.0",
"faucet": "0.0.1
npm --version 3.10.6
node --version v6.3.0

This line of TAP input with a colon:
ok 200 CallableReturningEventEmitter: unregistered event does not fire listener
produced by the tape assertion: t.equals(testobj.hit, 'dog', "CallableReturningEventEmitter: unregistered event does not fire listener")
results in messed-up faucet output:
image
what it should look like:
image

Faucet is incompatible with latest tap-parser

Faucet is currently configured to use tap-parser version 0.4.0. The latest version is 1.2.2, but faucet has several compatibility issues with it.

I can get it to run without crashing if I change res.number to res.id in the assert event handler, but the output is all messed up.

I discovered this in the process of investigating why faucet wasn't properly handing my TAP "Bail out!" notice. The reason is that it uses a tap-parser that does not emit bailout.

Check / X glyphs don't render in Windows TrueType fonts

Both Powershell and Command Prompt with font set to Consolas or Lucida Console exhibit the same behavior: the check and x glyphs appear as boxes with a question mark inside. Changing the font to Raster Fonts fixes the problem, but now you have the problem that your console is in an ugly font. :)

image

Render output in a tree instead of a flat list

We have a fantastic divider to structure test output in a tree.

It's files.

We could group the list of green ticks by which file the test('...') occur in.

The only problem is I'm not sure how to place file meta information in tap output or when calling faucet from the cli directly.

Don't mark diagnostic line with no test lines as "passing"?

I have a test that produces the following TAP output:

TAP version 13
# foo
# bar
ok 1 yay!

1..1
# tests 1
# pass  1

# ok

faucet gives this output:

✓ foo
✓ bar
# tests 1
# pass  1
✓ ok

I would have expected the foo line to not be marked as passing. I expected it to just remain # foo.

Output not shown in certain cases

I've found two different cases where the output of faucet is mysteriously missing:

  1. webstorm npm integration
    • executing a task through the npm tool window shows other output to stdout but not from faucet
  2. nodemon, example shown below

package.json:

  "scripts": {
    "test": "faucet",
    "test-auto": "nodemon --exec 'npm test'",
    "test-auto2": "fsmonitor -s npm test"
  }

cli:

$ npm test

> [email protected] test /Users/user/projects/test-config
> faucet

✓ getGlobalConfig returns default when process.env is not set
# tests 2
# pass  2
✓ ok
$ npm run test-auto

> [email protected] test-auto /Users/user/projects/test-config
> nodemon --exec 'npm test'

[nodemon] 1.9.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `npm test`

> [email protected] test /Users/user/projects/test-config
> faucet

^C
$ npm run test-auto2

> [email protected] test-auto2 /Users/user/projects/test-config
> fsmonitor -s npm test


Monitoring:  ~/projects/test-config
    filter:  **/
    action:  npm test

npm test

> [email protected] test /Users/user/projects/test-config
> faucet

✓ getGlobalConfig returns default when process.env is not set
# tests 2
# pass  2
✓ ok

......

I initially created an issue with nodemon, but it was suggested that the issue could be with how faucet is detecting the stdout stream.

Output is broken with AVA-style assertion descriptions

 12:40:42  dan@elise:~/stuff/vernamtools   master ✘ ✹ ✭ 
$ npm test

> [email protected] test /Users/dan/stuff/vernamtools
> ava -t test/index.js | faucet

✓ vernam is its own inverse: vernam(vernam(input, key), key) === input
# vernam is the identity function for null keys: vernam(input, nullS...
✓ vernam is the identity function for null keys: vernam(input, nullS...lStr) =✓ vernam(nullStr, key) === repeatUntilSize(key, nullStr.length)
# vernam(input, key, len) === vernam(input, key.slice(0, len)) if ke...
✓ vernam(input, key, len) === vernam(input, key.slice(0, len)) if ke...key.len# vernam(input, key, len) === vernam(input, padEnd(key, len, nullCha...
✓ vernam(input, key, len) === vernam(input, padEnd(key, len, nullCha...har)) i✓ vernam(input, key).length === input.length
✓ group("Hello, world!", 4) === ["Hoo!","e,r","l l","lwd"]
# tests 7
✓ pass 7

 12:40:50  dan@elise:~/stuff/vernamtools   master ✘ ✹ ✭ 
$ npm test

> [email protected] test /Users/dan/stuff/vernamtools
> ava -t test/index.js

TAP version 13
# vernam is its own inverse: vernam(vernam(input, key), key) === input
ok 1 - vernam is its own inverse: vernam(vernam(input, key), key) === input
# vernam is the identity function for null keys: vernam(input, nullStr) === input
ok 2 - vernam is the identity function for null keys: vernam(input, nullStr) === input
# vernam(nullStr, key) === repeatUntilSize(key, nullStr.length)
ok 3 - vernam(nullStr, key) === repeatUntilSize(key, nullStr.length)
# vernam(input, key, len) === vernam(input, key.slice(0, len)) if key.length < len
ok 4 - vernam(input, key, len) === vernam(input, key.slice(0, len)) if key.length < len
# vernam(input, key, len) === vernam(input, padEnd(key, len, nullChar)) if key.length > len
ok 5 - vernam(input, key, len) === vernam(input, padEnd(key, len, nullChar)) if key.length > len
# vernam(input, key).length === input.length
ok 6 - vernam(input, key).length === input.length
# group("Hello, world!", 4) === ["Hoo!","e,r","l l","lwd"]
ok 7 - group("Hello, world!", 4) === ["Hoo!","e,r","l l","lwd"]

1..7
# tests 7
# pass 7
# fail 0

Long assertion messages corrupt the formatted output

Assertions like t.ok(value, message) can be passed messages longer than usual terminal width. For example:

TAP version 13
# Exported dependency names can be resolved.
ok 1 The dependency "csui" should be resolvable.
ok 2 The dependency "esoc" should be resolvable.
# Resolving an unknown dependency fails.
ok 3 The message "Unrecognised dependency: "dummy"." should start with "Unrecognised dependency:".

1..3
# tests 3
# pass  3

# ok

The output appears to print the assertion message on two lines and when the test name is going to be printed, it ends up at the beginning of the first line too. For example:

✓ Exported dependency names can be resolved.
# Resolving an unknown dependency fails.
✓ Resolving an unknown dependency fails.ncy: "dummy"." should start with "Unre# tests 3
# pass  3
✓ ok

The expected output should contain only the test names:

✓ Exported dependency names can be resolved.
✓ Resolving an unknown dependency fails.
# pass  3
✓ ok

Doesn't support Unicode astral characters and emoji

Hi
I'm using faucet to format AVA + TAP output. Both default AVA error reporter and vanilla TAP show emoji in test results fine. However, Faucet doesn't understand emoji and often truncates the end of lines that have emoji, or shows broken symbols if error report consists of only emoji:

screen shot 2016-09-09 at 08 13 10

By the way, the AVA test in question was:

test.only('🦄🦄🦄', t => {
    t.pass();
});

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.