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

cube

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cube - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

2

lib/cube/event.js

@@ -31,3 +31,3 @@ // TODO include the event._id (and define a JSON encoding for ObjectId?)

function putter(request, callback) {
var time = new Date(request.time),
var time = "time" in request ? new Date(request.time) : new Date(),
type = request.type;

@@ -34,0 +34,0 @@

{
"name": "cube",
"version": "0.2.0",
"version": "0.2.1",
"description": "A system for analyzing time series data using MongoDB and Node.",

@@ -5,0 +5,0 @@ "keywords": ["time series"],

@@ -15,9 +15,2 @@ var vows = require("vows"),

var obj = { type: "test"
, time: (new Date).toISOString()
, data: { foo: "bar" }
};
var arr = [obj];
var num = 42;
server.register = cube.collector.register;

@@ -39,3 +32,9 @@

"POST /event/put with a JSON object": {
topic: test.request({method: "POST", port: port, path: "/1.0/event/put"}, JSON.stringify(obj)),
topic: test.request({method: "POST", port: port, path: "/1.0/event/put"}, JSON.stringify({
type: "test",
time: new Date,
data: {
foo: "bar"
}
})),
"responds with status 400": function(response) {

@@ -50,3 +49,9 @@ assert.equal(response.statusCode, 400);

"POST /event/put with a JSON array": {
topic: test.request({method: "POST", port: port, path: "/1.0/event/put"}, JSON.stringify(arr)),
topic: test.request({method: "POST", port: port, path: "/1.0/event/put"}, JSON.stringify([{
type: "test",
time: new Date,
data: {
foo: "bar"
}
}])),
"responds with status 200": function(response) {

@@ -61,3 +66,3 @@ assert.equal(response.statusCode, 200);

"POST /event/put with a JSON number": {
topic: test.request({method: "POST", port: port, path: "/1.0/event/put"}, JSON.stringify(num)),
topic: test.request({method: "POST", port: port, path: "/1.0/event/put"}, JSON.stringify(42)),
"responds with status 400": function(response) {

@@ -70,2 +75,17 @@ assert.equal(response.statusCode, 400);

suite.addBatch(test.batch({
"POST /event/put without an associated time": {
topic: test.request({method: "POST", port: port, path: "/1.0/event/put"}, JSON.stringify([{
type: "test",
data: {
foo: "bar"
}
}])),
"responds with status 200": function(response) {
assert.equal(response.statusCode, 200);
assert.deepEqual(JSON.parse(response.body), {});
}
}
}));
suite.export(module);
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