This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("MyGallery", () => { | |
it("init set correct property when called (thumb size, thumbs count)", () => {}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("A set of functionalities", () => { | |
it("should do something nice", () => {}); | |
describe("A subset of functionalities", () => { | |
it("should do something great", () => {}); | |
it("should do something awesome", () => {}); | |
}); | |
describe("Another subset of functionalities", () => { | |
it("should also do something great", () => {}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("A set of functionalities", () => { | |
it("a set of functionalities should do something nice", () => {}); | |
it("a subset of functionalities should do something great", () => {}); | |
it("a subset of functionalities should do something awesome", () => {}); | |
it("another subset of functionalities should also do something great", () => {}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const faker = require("faker"); | |
const userFactory (data = {}) => { | |
const username = faker.hacker.noun() + faker.random.number(); | |
return { | |
username: username, | |
email: `${username}@crowdhome.test`, | |
phoneNumber: faker.phone.phoneNumber(), | |
...data | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const request = require("supertest"); | |
jest.mock("node-fetch", () => require("fetch-mock-jest").sandbox()); | |
const fetchMock = require("node-fetch"); | |
it("validates general PDF investment for user", async (done) => { | |
fetchMock.mock("https://weryfikacjapodpisu.pl/api/verify", { | |
body: fs.readFileSync("./tests/poa/weryf_correct.json", "utf8"), | |
}); | |
await request(app.server) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const should = require('should'); | |
const mockery = require('mockery'); | |
const nodemailerMock = require('nodemailer-mock'); | |
describe('Tests that send email', async () { | |
before(async () { | |
mockery.enable({warnOnUnregistered: false}); // Enable mockery to mock objects | |
mockery.registerMock('nodemailer', nodemailerMock) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const should = require('should'); | |
const mockery = require('mockery'); | |
const nodemailerMock = require('nodemailer-mock'); | |
describe('Tests that send email', async () { | |
before(async () { | |
mockery.enable({warnOnUnregistered: false}); // Enable mockery to mock objects | |
mockery.registerMock('nodemailer', nodemailerMock) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
beforeEach(() => { | |
initializeCityDatabase(); | |
}); | |
afterEach(() => { | |
clearCityDatabase(); | |
}); | |
test("city database has Vienna", () => { | |
expect(isCity("Vienna")).toBeTruthy(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Jest | |
describe("Sum numbers", () => { | |
test("it should sum two numbers correctly", () => { | |
expect(1 + 2).toEqual(3); | |
}); | |
}); | |
// Jasmine | |
describe("Sum numbers", function () { | |
it("should sum two numbers correctly", function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TEST. framework codeceptjs | |
Feature("My First Test"); | |
Scenario("test something", ({ I }) => { | |
I.amOnPage("https://github.com"); | |
I.see("GitHub"); | |
}); |