Skip to content

Instantly share code, notes, and snippets.

View didil's full-sized avatar

Adil H didil

View GitHub Profile
const expect = require('chai').expect;
const sinon = require('sinon');
const asyncConcatService = require("../../../lib/asyncConcatService");
let asyncConcat = require("../../../functions/asyncConcat");
describe('asyncConcat', function asyncConcatTest() {
let concatStub;
const expect = require('chai').expect;
const asyncConcatService = require('../../../lib/asyncConcatService');
describe('asyncConcatService', function () {
it('concats', async () => {
let a = "Serverless";
let b = "is awesome";
let result = await asyncConcatService.concat(a, b);
const { spawn } = require('child_process');
const getSlsOfflinePort = require('./support/getSlsOfflinePort');
let slsOfflineProcess;
before(function (done) {
// increase mocha timeout for this hook to allow sls offline to start
this.timeout(30000);
console.log("[Tests Bootstrap] Start");
const request = require('supertest');
const expect = require('chai').expect;
const getSlsOfflinePort = require('../support/getSlsOfflinePort');
describe('getAsyncConcat', function getAsyncConcatTest() {
it('ok', function it(done) {
request(`http://localhost:${getSlsOfflinePort()}`)
.get(`/asyncConcat?a=it&b=works`)
.expect(200)
@didil
didil / function.go
Last active January 18, 2019 17:44
package gcf_go_image_resizer
import (
"bytes"
"errors"
"github.com/disintegration/imaging"
"image"
"image/jpeg"
"io"
"net/http"
@didil
didil / main.go
Last active February 13, 2019 11:16
goblero-demo
package main
import (
"flag"
"fmt"
"log"
"os"
"os/signal"
"syscall"
"time"
@didil
didil / main.go
Created February 21, 2019 04:48
WASM Boilerplate
package main
import (
"syscall/js"
)
func main() {
// exit channel
ch := make(chan struct{})
@didil
didil / input.go
Last active February 21, 2019 04:54
go wasm elevator saga input.go
package main
import (
"syscall/js"
)
func Init(args []js.Value) {
elevators := args[0]
//floors := args[1]
@didil
didil / server.go
Created February 21, 2019 04:59
go wasm elevator saga api server
package api
import (
"context"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
@didil
didil / gowasmbuilder.js
Last active February 21, 2019 05:24
gowasm elevator js
window.GoWasmBuilder = {
exitWasm: null,
codeObj: null,
mod: null,
inst: null,
apiRoot: null,
async init(bytes) {
// load the go module
GoWasmBuilder.go = new Go();