npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jasminetea

v0.3.0-alpha.1

Published

Unfancy Jasmine2 in Node.js

Downloads

89

Readme

Jasminetea NPM version Build Status Coverage Status

          {
       }   }   {
      {   {  }  }
       }   }{  {
      {  }{  }  }          
     { }{ }{  { }          
   .- { { }  { }} -.       
  (  { } { } { } }  )      
  |`-..________ ..-'|      
  |                 |      
  |                 ;--.   
  |          ___    (__  \           _            _             
  |         |_  |    | )  )         (_)          | |            
  |           | | __ _ ___ _ __ ___  _ _ __   ___| |_ ___  __ _ 
  |           | |/ _` / __| '_ ` _ \| | '_ \ / _ \ __/ _ \/ _` |
  |       /\__/ / (_| \__ \ | | | | | | | | |  __/ ||  __/ (_| |
  |       \____/ \__,_|___/_| |_| |_|_|_| |_|\___|\__\___|\__,_|
   `-.._________..    

is Jasmine2 using CoffeeScript in Node.js

Getting started

.
├─ src
│  └─ index.coffee
└─ test
   └─ api.spec.coffee

./src/index.coffee

class MyModule
  encode: (str)->
    'data:text/plain;base64,'+(new Buffer str).toString 'base64'

  decode: (datauri)->
    (new Buffer datauri.slice(datauri.indexOf(',')+1),'base64').toString()

module.exports= new MyModule
module.exports.MyModule= MyModule

./test/index.coffee

MyModule= (require '../src').MyModule
myModule= require '../src'

fixture= 'foo'

describe 'API',->
  datauri= null

  it 'instanceof MyModule',->
    expect(myModule instanceof MyModule).toBe true

  it 'encode',->
    datauri= myModule.encode fixture
    expect(datauri).toBe 'data:text/plain;base64,'+(new Buffer fixture).toString 'base64'
  
  it 'decode',->
    str= myModule.decode datauri 
    expect(str).toBe fixture

1, 2, 3, Jasminetea!

$ npm install jasminetea --global

$ jasminetea
#
#  7_P +361 ms Found 1 files in test/*[sS]pec.coffee ...
# 
# 
# Running 3 specs.
# 
# API
#     instanceof MyModule: passed
#     encode: passed
#     decode: passed
# 
# 3 specs, 0 failures
# Finished in 0 seconds

More commands

--lint, -l

Check the code quality in *.coffee and src/*.coffee and test/*.coffee After the test. by CoffeeLint. Use .coffeelintrc as config if exists current working directory or home directory(e.g.~/.coffeelintrc). If change the subject then Type the glob separated by commas After the --lint.

Example:

$ jasminetea --lint
# 7_P +182ms Found 4 files in test/*[sS]pec.coffee ...
# ...
# 7_P    +1s Lint in *.coffee and src/*.coffee and test/*.coffee ...
# ...
# ✓ Ok! » 0 errors and 0 warnings in 8 files

$ jasminetea --lint foo/bar/baz/**/*.spec.coffee
# 7_P +182ms Found 4 files in test/*[sS]pec.coffee ...
# ...
# 7_P    +1s Skip --lint.   Because not exists in foo/bar/baz/**/*.spec.coffee

--cover, -c

Calculate the code coverage in src After the test. by Ibrik

$ jasminetea --cover
# 7_P +182ms Found 4 files in test/*[sS]pec.coffee ...
# ...
# 7_P    +1s Calculating...
# =============================================================================
# Writing coverage object [/Users/59naga/Downloads/jasminetea/coverage/coverage.json]
# Writing coverage reports at [/Users/59naga/Downloads/jasminetea/coverage]
# =============================================================================
# 
# =============================== Coverage summary ===============================
# Statements   : 88.65% ( 336/379 )
# Branches     : 64.84% ( 83/128 )
# Functions    : 88.57% ( 62/70 )
# Lines        : 92.75% ( 179/193 )
# ================================================================================

Also, Can post the coverage report to coveralls.io If use --report Need to beforehand set the COVERALLS_REPO_TOKEN in environment or .coveralls.yml

$ export COVERALLS_REPO_TOKEN=my_coveralls_repo_token
$ jasminetea --cover --report
# 7_P +182ms Found 4 files in test/*[sS]pec.coffee ...
# ...
# 7_P    +1s Calculating...
# ...
# 7_P    +6s Posted a coverage report.

The process exits with code 1 if test failing or no specs found.

$ jasminetea unknown/directory --cover && echo "success" || echo "failure"
# 7_P +206ms Spec not exists in unknown/directory/*[sS]pec.coffee
# 7_P   +3ms Skip --cover.  Because not exists in unknown/directory/*[sS]pec.coffee
# failure

-w, --watch

Monitor changes in *.coffee and src/*.coffee and test/*.coffee after the above commands if use option. Re-execution the jasminetea if has been changed in globs. If change the subject then Type the glob separated by commas After the --watch.

$ jasminetea --watch
# 7_P +182ms Found 4 files in test/*[sS]pec.coffee ...
# ...
# 7_P    +1s Lint in *.coffee and src/*.coffee and test/*.coffee ...
# ...
# 7_P    +1s Watch in *.coffee and src/*.coffee and test/*.coffee ...

$ jasminetea --watch foo/bar/baz/**/*.spec.coffee
# 7_P +182ms Found 4 files in test/*[sS]pec.coffee ...
# ...
# 7_P    +1s Watch in foo/bar/baz/**/*.spec.coffee ...

Other options

See $ jasminetea --help

#
#  Usage: jasminetea [specDir] [options...]
#
#  Options:
#
#    -h, --help            output usage information
#    -V, --version         output the version number
#    -c --cover            Use ibrik, Code coverage calculation
#    --report              Send lcov.info to coveralls.io via --cover
#    -l --lint [globs]     Use .coffeelintrc, Code linting after run. Find in [globs] (can use "," separator)
#    -w --watch [globs]    Watch file changes. See [globs] (can use "," separator)
#    -f --file [specGlob]  Target [specGlob] (default "*[sS]pec.coffee")
#    -r --recursive        Search to recursive directory
#    -S --silent           Use dots reporter
#    -s --stacktrace       Output stack trace
#    -t --timeout <msec>   Success time-limit (default 500 msec)
#    -d --debug            Output raw commands
#

License

[MIT][License] [License]: http://59naga.mit-license.org/