New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ribcage-gen

Package Overview
Dependencies
Maintainers
2
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ribcage-gen - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

57

component-template/test.js
var test = require('prova')
, {{PascalName}} = require('./index.js')
, sinon = require('sinon')
, createView = function createView(options){

@@ -7,5 +8,5 @@ return new {{PascalName}}(options)

test('{{PascalName}} Component: constructor', function(t){
test('{{PascalName}}: constructor', function(t){
var view = createView()
var view = createView()
t.equal(

@@ -20,6 +21,56 @@ typeof view

test('{{PascalName}} Component: beforeInit', function(t){
test('{{PascalName}}#bindEvents', function (t){
var view = createView()
, fn = view.bindEvents
, stopListening
function setup(){
stopListening = sinon.spy(view, 'stopListening')
}
function cleanup(){
stopListening.restore()
}
setup()
// call bind events
fn.call(view)
t.ok(
stopListening.calledOnce
, 'calls stopListening so that events aren\'t bound multiple times'
)
t.ok(
stopListening.calledWith(view.state)
, 'calls stopListening with the state so that not all listeners are removed'
)
cleanup()
t.end()
})
test('{{PascalName}}#beforeInit', function(t){
var view = createView()
, fn = view.beforeInit
fn.call(view)
t.ok(
view.state instanceof view.State
, 'creates a state model'
)
t.end()
})
test('{{PascalName}}#context', function(t){
var view = createView()
, fn = view.context
t.deepEqual(
fn.call(view)
, view.state.toJSON()
, 'uses the state to pass variables to the template'
)
t.end()
})

2

package.json
{
"name": "ribcage-gen",
"version": "0.2.0",
"version": "0.2.1",
"description": "A generator script for ribcage components",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc