minor fixes

This commit is contained in:
Ilya Kantor 2021-01-23 23:30:28 +03:00
parent 51edbb1236
commit 5a024624af
14 changed files with 57 additions and 22 deletions

View file

@ -1,12 +0,0 @@
In the code below, each line corresponds to the item in the task list.
```js run
let admin, name; // can declare two variables at once
name = "John";
admin = name;
alert( admin ); // "John"
```

View file

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

View file

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

View file

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

View file

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

View file

@ -1,10 +0,0 @@
importance: 2
---
# Working with variables
1. Declare two variables: `admin` and `name`.
2. Assign the value `"John"` to `name`.
3. Copy the value from `name` to `admin`.
4. Show the value of `admin` using `alert` (must output "John").

View file

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

View file

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

View file

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

View file

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

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,5 @@
describe("Test", function() {
it(`user equals "John"`, function() {
expect(user).toEqual("John");
});
});

View file

@ -0,0 +1,6 @@
describe("Test", function() {
it(`user and admin equal "John"`, function() {
expect(user).toEqual("John");
expect(admin).toEqual("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");
});
});