minor fixes

This commit is contained in:
Ilya Kantor 2021-06-09 07:07:18 +03:00
parent 5a024624af
commit d20a6e3d5e
33 changed files with 357 additions and 395 deletions

View file

@ -0,0 +1,2 @@
let admin;
let user;

View file

@ -0,0 +1,4 @@
# Working with variables
Declare two variables: `admin` and `user`.

View file

@ -0,0 +1,9 @@
describe("Test", function() {
it("declares `admin`", function() {
admin; // error if not declared
});
it("declares `user`", function() {
user; // error if not declared
});
});

View file

@ -0,0 +1,4 @@
let user;
let admin;
user = "John";

View file

@ -0,0 +1 @@
Assign the value `"John"` to `user`.

View file

@ -0,0 +1,5 @@
describe("Test", function() {
it(`user has a value: "John"`, function() {
expect(user).toEqual("John");
});
});

View file

@ -0,0 +1,5 @@
let user, admin;
user = "John";
admin = user;

View file

@ -0,0 +1 @@
Copy the value from `user` to `admin`.

View file

@ -0,0 +1,6 @@
describe("Test", function() {
it(`user and admin have value "John"`, function() {
expect(user).toEqual("John");
expect(admin).toEqual("John");
});
});

View file

@ -0,0 +1,7 @@
let user, admin;
user = "John";
admin = user;
alert(admin);

View file

@ -0,0 +1 @@
Show the value of `admin` using `alert` (will show "John").

View file

@ -0,0 +1,14 @@
let nativeAlert = globalThis.alert;
globalThis.alert = jasmine.createSpy();
describe("Test", function() {
after(function() {
globalThis.alert = this.alert;
});
it(`user and admin equal "John"`, function() {
expect(user).toEqual("John");
expect(admin).toEqual("John");
});
});