Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tobi

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tobi - npm Package Compare versions

Comparing version 0.0.8 to 0.1.0

._History.md

6

History.md
0.1.0 / 2011-01-07
==================
* Added `createBrowser(port, host)` support
* Added `.include` modifier support to the `.text()` assertion method
0.0.8 / 2010-12-29

@@ -3,0 +9,0 @@ ==================

5

lib/._tobi.js

@@ -1,1 +0,4 @@

Mac OS X  2��ATTR���� � com.macromates.caretx���R������<[k0?'3/«��
Mac OS X  2��ATTR�̒��#�#com.macromates.caret{
column = 24;
line = 11;
}

2

lib/assertions/._should.js

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�����#�#com.macromates.caret{
Mac OS X  2��ATTR�̛��#�#com.macromates.caret{
column = 50;
line = 60;
}

@@ -23,6 +23,7 @@

var port = 9000;
var startingPort = 9000;
/**
* Initialize a new `Browser` with the given `html` or `server`.
* Initialize a new `Browser` with the given `html`, `server`
* or `port` and `host`.
*

@@ -33,8 +34,16 @@ * Options:

*
* @param {String|http.Server} html
* @param {Object} options
* @param {String|http.Server|Number} html
* @param {Object|String} options
* @param {Object} c
* @api public
*/
var Browser = module.exports = exports = function Browser(html, options) {
var Browser = module.exports = exports = function Browser(html, options, c) {
var host, port;
// Host as second arg
if ('string' == typeof options) host = options, options = null;
// Options as third arg
if (c) options = c;
// Initialize
options = options || {};

@@ -44,3 +53,9 @@ this.external = options.external;

this.cookieJar = new CookieJar;
if ('string' == typeof html) {
// Client types
if ('number' == typeof html) {
port = html;
this.port = html;
this.host = host;
} else if ('string' == typeof html) {
this.parse(html);

@@ -117,14 +132,11 @@ } else {

, server = this.server
, host = '127.0.0.1'
, host = this.host || '127.0.0.1'
, headers = options.headers || {};
// Ensure server
if (!server) throw new Error('no .server present');
// Ensure that server is ready to take connections
if (!server.fd){
if (server && !server.fd){
(server.__deferred = server.__deferred || [])
.push(arguments);
if (!server.__started) {
server.listen(server.__port = ++port, host, function(){
server.listen(server.__port = ++startingPort, host, function(){
process.nextTick(function(){

@@ -157,7 +169,12 @@ server.__deferred.forEach(function(args){

// HTTP client
if (!server.client) {
server.client = http.createClient(server.__port);
if (!this.client) {
// portno & host supplied
if (this.port && this.host) {
this.client = http.createClient(this.port, this.host);
} else {
this.client = http.createClient(server.__port);
}
}
var req = server.client.request(method, path, headers);
var req = this.client.request(method, path, headers);
req.on('response', function(res){

@@ -164,0 +181,0 @@ var status = res.statusCode

@@ -1,1 +0,1 @@

Mac OS X  2��ATTR����� � com.macromates.caretx���R������<[k0?'3/«��
Mac OS X  2��ATTR�̘�� � com.macromates.caretx���R������<[k0?'3/«��

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�����"�"com.macromates.caret{
Mac OS X  2��ATTR�̔��"�"com.macromates.caret{
column = 0;
line = 12;
}

@@ -12,3 +12,3 @@

exports.version = '0.0.8';
exports.version = '0.1.0';

@@ -37,4 +37,4 @@ /**

exports.createBrowser = function(str, options){
return new exports.Browser(str, options);
exports.createBrowser = function(a,b,c){
return new exports.Browser(a,b,c);
};

@@ -41,0 +41,0 @@

{ "name": "tobi"
, "description": "expressive server-side functional testing with jQuery and jsdom"
, "version": "0.0.8"
, "version": "0.1.0"
, "author": "TJ Holowaychuk <tj@vision-media.ca>"

@@ -5,0 +5,0 @@ , "keywords": ["test", "testing", "browser", "jquery", "css"]

@@ -37,4 +37,8 @@

Tobi provides the `Browser` object, created via `tobi.createBrowser(app)`, where `app` is a node `http.Server`, so for example Connect or Express apps will work just fine. There is no need to invoke `listen()` as this is handled by Tobi.
Tobi provides the `Browser` object, created via `tobi.createBrowser(app)`, where `app` is a node `http.Server`, so for example Connect or Express apps will work just fine. There is no need to invoke `listen()` as this is handled by Tobi, and requests will be deferred until the server is listening.
Alternatively you may pass a `port` and `host` to `createBrowser()`, for example:
var browser = tobi.createBrowser(80, 'lb.dev');
### Evaluate External Resources

@@ -41,0 +45,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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