This file contains 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
import {} from "protractor"; | |
import {BetterProtractorService} from "better-protractor"; | |
const service: BetterProtractorService = new BetterProtractorService(); | |
describe('Mobiflip', () => { | |
it('should navigate to Mobiflip page', async() => { | |
service.disableAngular(); | |
service.navigateToRoute('https://mobiflip.de'); | |
service.pauseBrowserTemporarily(500); |
This file contains 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
// app.js: register the route. In our case, we don't want authorization for this route | |
app.use('/healthcheck', require('./routes/healthcheck.routes')); | |
// healthcheck.routes.js: return a 2xx response when your server is healthy, else send a 5xx response | |
import express from 'express'; | |
const router = express.Router({}); | |
router.get('/', async (_req, res, _next) => { | |
// optional: add further things to check (e.g. connecting to dababase) |
This file contains 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
// ... | |
storiesOf('Forms|JsonFormControlComponent', module) | |
.addDecorator(withKnobs) // optional: requires https://www.npmjs.com/package/@storybook/addon-knobs to be installed | |
.addDecorator(moduleMetadata({ | |
imports: [FormsModule], | |
declarations: [JsonFormControlComponent] // the component we want to test | |
})) | |
.add('using an object', () => ({ | |
component: JsonFormControlComponent, // if you want to have control over the template, you should use "template" instead |
This file contains 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('JsonFormControlComponent', () => { | |
let fixture: ComponentFixture < JsonFormControlComponent > ; | |
let emitValueSpy: jasmine.Spy; | |
beforeEach(() => | |
TestBed.configureTestingModule({ | |
declarations: [JsonFormControlComponent], // the component we want to test | |
schemas: [NO_ERRORS_SCHEMA] // optional: ignore other custom elements |
This file contains 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 fs = require('fs'); | |
function readCsvFile(csvFilePath) { | |
const csvFileContent = (await fs.readFile(csvFilePath)).toString(); | |
return parse(csvFileContent, {skipEmptyLines: true, header: true}); | |
} | |
readCsvFile('some-path'); |
This file contains 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
/** | |
* Changes in components using OnPush strategy are only applied once when calling .detectChanges(), | |
* This function solves this issue. | |
*/ | |
export async function runOnPushChangeDetection(fixture: ComponentFixture<any>): Promise<void> { | |
const changeDetectorRef = fixture.debugElement.injector.get<ChangeDetectorRef>(ChangeDetectorRef); | |
changeDetectorRef.detectChanges(); | |
return fixture.whenStable(); | |
} |
This file contains 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
# This file is a template, and might need editing before it works on your project. | |
# Official framework image. Look for the different tagged releases at: | |
# https://hub.docker.com/r/library/node/tags/ | |
image: node:12.10.0 | |
# This folder is cached between builds | |
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache | |
cache: | |
paths: | |
- node_modules/ |
This file contains 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
<main> | |
<table class="table is-fullwidth"> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Age</th> | |
<th>Job</th> | |
<th>Color</th> | |
<th>URL</th> | |
</tr> |
This file contains 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
package net.example.demo; | |
import com.fasterxml.jackson.annotation.JsonInclude; | |
import com.fasterxml.jackson.annotation.JsonInclude.Include; | |
import java.io.Serializable; | |
import lombok.AllArgsConstructor; | |
import lombok.Data; | |
import lombok.NoArgsConstructor; | |
@Data |
This file contains 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('Jasmine & Jest expectations', () => { | |
it('can match anything if we do not care for specific parameters', () => { | |
const spyTrackEvent = spyOn(loginService, 'trackUserLoginEvent').and.callThrough(); | |
loginService.loginUser('[email protected]', 'justcoderthings'); | |
// we expect that the spied function has been called with 3 parameters: a number, the string "2021-01-21" and anything | |
expect(spyTrackEvent).toHaveBeenCalledWith(jasmine.any(Number), '2021-01-21', jasmine.anything()); | |
}); | |
it('can match partial strings (regex)', () => { |
OlderNewer