minor fixes
This commit is contained in:
parent
5a024624af
commit
d20a6e3d5e
33 changed files with 357 additions and 395 deletions
|
@ -0,0 +1,2 @@
|
|||
let admin;
|
||||
let user;
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
# Working with variables
|
||||
|
||||
Declare two variables: `admin` and `user`.
|
|
@ -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
|
||||
});
|
||||
});
|
|
@ -0,0 +1,4 @@
|
|||
let user;
|
||||
let admin;
|
||||
|
||||
user = "John";
|
|
@ -0,0 +1 @@
|
|||
Assign the value `"John"` to `user`.
|
|
@ -0,0 +1,5 @@
|
|||
describe("Test", function() {
|
||||
it(`user has a value: "John"`, function() {
|
||||
expect(user).toEqual("John");
|
||||
});
|
||||
});
|
|
@ -0,0 +1,5 @@
|
|||
let user, admin;
|
||||
|
||||
user = "John";
|
||||
|
||||
admin = user;
|
|
@ -0,0 +1 @@
|
|||
Copy the value from `user` to `admin`.
|
|
@ -0,0 +1,6 @@
|
|||
describe("Test", function() {
|
||||
it(`user and admin have value "John"`, function() {
|
||||
expect(user).toEqual("John");
|
||||
expect(admin).toEqual("John");
|
||||
});
|
||||
});
|
|
@ -0,0 +1,7 @@
|
|||
let user, admin;
|
||||
|
||||
user = "John";
|
||||
|
||||
admin = user;
|
||||
|
||||
alert(admin);
|
|
@ -0,0 +1 @@
|
|||
Show the value of `admin` using `alert` (will show "John").
|
|
@ -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");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue