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 { eggs, eggsAsync } from "../src/eggs"; | |
import { spam, spamAsync } from "../src/spam"; | |
jest.mock("../src/spam"); | |
describe("Synchronous Implementation", () => { | |
describe("non-mocked", () => { | |
beforeEach(() => { (spam as jest.Mock).mockImplementationOnce((a: number) => 10 * a) }); | |
it("performs some calculations", () => { |
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 { eggs } from "../src/eggs"; | |
import { spam } from "../src/spam"; | |
describe("normal", () => { | |
it("does some calculations", () => { | |
expect(eggs(3)).toEqual(72); | |
}); | |
}); | |
describe("mocked", () => { |
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
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<script> | |
function listen() { | |
const ro = new ResizeObserver(entries => { for (let entry of entries) { entry.target.style.borderRadius = Math.max(0, 250 - entry.contentRect.width) + 'px'; } }); | |
var elements = document.querySelectorAll('[adaptive]'); | |
for (var element, i = 0; element = elements[i]; i++) { ro.observe(element); } | |
} |
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
################################################################################ | |
# Please Note: this version requires https://github.com/khiav223577/in_batches # | |
################################################################################ | |
class AddLifecycleWebPushPermittedToUsers < ActiveRecord::Migration | |
disable_ddl_transaction! | |
def up | |
ActiveRecord::Base.transaction do | |
add_column :users, :lifecycle_web_push_permitted, :boolean, default: nil | |
execute('ALTER TABLE users ALTER COLUMN lifecycle_web_push_permitted SET DEFAULT false') |
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
require 'json' | |
require 'zlib' | |
require 'yaml' | |
require 'base64' | |
abort('Please proide the absolute path to VCR YAML file') if ARGV.size < 1 | |
begin | |
filepath = ARGV[0] | |
yaml = YAML.load(File.read(filepath)) |
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 main | |
import ( | |
"encoding/json" | |
"github.com/aws/aws-lambda-go/events" | |
"github.com/aws/aws-lambda-go/lambda" | |
) | |
type MyResponse struct { | |
ResponseId string |
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 au.com.mebank.awesomeservice.performance | |
import org.junit.jupiter.api.BeforeEach | |
import org.junit.jupiter.api.Test | |
import org.testcontainers.containers.GenericContainer | |
import org.testcontainers.images.builder.ImageFromDockerfile | |
class KGenericContainer(dockerImageName: ImageFromDockerfile): | |
GenericContainer<KGenericContainer>(dockerImageName) |
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
{ | |
"accountPan": "123", | |
"tokens": [ | |
{ | |
"tokenUniqueReference": "...", | |
"tokenNumber": "...", | |
"maskedTokenNumber": "...", | |
"correlationId": "...", | |
"currentStatusDescription": "...", | |
"currentStatusDateTime": "...", |
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
@Component | |
open class PushAccountMapper @Autowired | |
constructor(private val validator: Validator, private val objectMapper: ObjectMapper) : (String) -> CardProvisioningRequest { | |
@Throws(ServiceException::class) | |
override fun invoke(payload: String): CardProvisioningRequest { | |
try { | |
val request = objectMapper.readValue(payload, CardProvisioningRequest::class.java) | |
val violations = validator.validate(request) |
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 au.com.mebank.integration.dwbfaprovisioning.operation.pushAccount | |
import au.com.mebank.integration.dwbfaprovisioning.errors.BFAProvisioningErrorSpecification | |
import au.com.mebank.integration.dwbfaprovisioning.models.MDESPushAccountResponse | |
import au.com.mebank.integration.reactivesoap.error.ServiceException | |
import org.springframework.http.MediaType | |
import org.springframework.web.reactive.function.BodyInserters | |
import org.springframework.web.reactive.function.server.ServerResponse | |
import reactor.core.publisher.Mono |
NewerOlder