Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Update queue-spec.js #859

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions spec/queue-spec.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@

var Q = require("../q");
var Queue = require("../queue");
let Q = require("../q");
let Queue = require("../queue");

global.Q = Q;
require("./lib/jasmine-promise");

describe("queue", function () {

it("should enqueue then dequeue", function () {
var queue = Queue();
let queue = Queue();
queue.put(1);
return queue.get().then(function (value) {
expect(value).toBe(1);
});
});

it("should dequeue then enqueue", function () {
var queue = Queue();
var promise = queue.get().then(function (value) {
let queue = Queue();
let promise = queue.get().then(function (value) {
expect(value).toBe(1);
});
queue.put(1);
return promise;
});

it("should stream", function () {
var queue = Queue();
let queue = Queue();

Q.try(function () {
return Q.delay(20).then(function () {
Expand Down Expand Up @@ -66,7 +66,7 @@ describe("queue", function () {
});

it("should be order agnostic", function () {
var queue = Queue();
let queue = Queue();

Q.try(function () {
return Q.delay(20).then(function () {
Expand Down Expand Up @@ -103,7 +103,7 @@ describe("queue", function () {

it("should close", function () {

var queue = Queue();
let queue = Queue();

Q.try(function () {
return Q.delay(20).then(function () {
Expand Down Expand Up @@ -155,7 +155,7 @@ describe("queue", function () {

it("should close with alternate error", function () {

var queue = Queue();
let queue = Queue();
queue.close(new Error("Alternate reason"));

return Q.try(function () {
Expand Down