Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved ES6 consistency #13

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
12 changes: 6 additions & 6 deletions src/chapter3/ch3-q1.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import * as classes from './ch3-q1';
for (let key in classes) {
let Stack = classes[key];

describe('ch3-q1: ' + key, function() {
describe('ch3-q1: ' + key, () => {

beforeEach(function() {
beforeEach(() => {
this.stack = new Stack();
});

it('can push and pop values from middle stack correctly', function() {
let stack = [];
it('can push and pop values from middle stack correctly', () => {
const stack = [];
for (let i = 1; i < 100; i += 4) {
let val = Math.trunc(Math.random() * 999999);
this.stack.push(2, val);
Expand All @@ -21,8 +21,8 @@ for (let key in classes) {
stack.reverse().forEach(v => expect(this.stack.pop(2)).to.equal(v));
});

it('can push, peek and pop values from all 3 stacks correctly', function() {
let stacks = [[], [], []];
it('can push, peek and pop values from all 3 stacks correctly', () => {
const stacks = [[], [], []];
for (let j = 9; j > 0; --j) {
for (let i = 1; i <= 3; ++i) {
let val = i * 10 + j;
Expand Down