Other technologies Flashcards

1
Q

Jest

A

describe(“FizzBuzz”, () => {
test(‘[3] should result in “fizz”’, () => {
expect(fizz_buzz([3])).toBe(‘fizz’);
});

test('[5] should result in "buzz"', () => {
  expect(fizz_buzz([5])).toBe('buzz');
}); });

beforeEach and afterEach: These hooks are executed before and after each test in the test suite.
beforeAll and afterAll: These hooks are executed just once for each test suite. i.e. if a test suite has 10 tests, then these hooks will just be executed once for every test execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

middleware (Thunk / Saga)

A

Redux Thunk is a middleware that lets you call action creators that return a function instead of an action object.
That function receives the store’s dispatch method, which is then used to dispatch regular synchronous actions inside the function’s body once the asynchronous operations have been completed.

(Saga works like a separate thread or a background process that is solely responsible for making your side effects or API calls unlike redux-thunk, which uses callbacks which may lead to situations like ‘callback hell’ in some cases. However, with the async/await system, this problem can be minimized in redux-thunk.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Mongo DB

A

fetch keyword:

findOneListingByName

How well did you know this?
1
Not at all
2
3
4
5
Perfectly