Skip to content

Instantly share code, notes, and snippets.

View EdyVision's full-sized avatar

Eidan Rosado EdyVision

View GitHub Profile
@EdyVision
EdyVision / release.yml
Last active June 28, 2023 21:40
A GitHub workflow that automatically creates a tag and release based on poetry version mismatch (publishes to GitHub and Pypi)
# Automatically creates a new tag, GitHub release, and PyPi release if poetry version doesn't match last release version
name: Release
on:
workflow_dispatch:
branches:
- main
push:
branches:
version: '3.8'
services:
mongo:
image: mongo
restart: always
ports:
- 27017:27017
bookapi:
image: bookapi
@EdyVision
EdyVision / drugSearchController.test.js
Last active July 23, 2019 00:56
Drug Search Controller Test with Sinon Spy
/* eslint-disable no-undef */
/* eslint-disable no-unused-vars */
const expect = require('chai').expect;
const sinon = require('sinon');
let drugSearchCtrl = require('../../functions/drugSearch/drugSearchCtrl');
let nlmSearch = require('../../functions/drugSearch/services/nlmSearch');
describe('drugSearchCtrl getDrugIdentifiers', function drugSearchCtrlTest() {
// NLM Drug Search Service Spy
@EdyVision
EdyVision / drugSearchPackage.json
Last active July 8, 2019 01:40
Drug Search Package.json
{
"name": "drug-search-service",
"version": "1.0.0",
"description": "Drug Search Service API code",
"main": "handler.js",
"scripts": {
"start": "sls offline --noAuth",
"test": "SLS_DEBUG=* NODE_ENV=test PORT=9100 ./node_modules/.bin/nyc ./node_modules/.bin/mocha --opts mocha.opts",
"debug": "export SLS_DEBUG=* && node --inspect /usr/local/bin/serverless offline -s dev --noAuth",
"offline": "sls offline start",
@EdyVision
EdyVision / launch.json
Created July 8, 2019 01:38
VSCode Debugger Configurations for Serverless Projects
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type":"node",
"request":"launch",
"name":"Serverless Offline Debug",
@EdyVision
EdyVision / slsOfflineTestConfig.js
Last active July 8, 2019 00:26
Serverless Offline Port for Tests
module.exports.getSlsOfflinePort = () => {
return process.env.PORT || '3005';
};
@EdyVision
EdyVision / bootstrap.test.js
Last active July 8, 2019 00:25
Serverless Test Bootstrapping File
/* eslint-disable no-undef */
const { spawn } = require('child_process');
const slsOfflineTestConfig = require('./support/slsOfflineTestConfig');
let slsOfflineProcess;
before(function(done) {
// increase mocha timeout for this hook to allow sls offline to start
this.timeout(30000);
@EdyVision
EdyVision / .travis.yml
Last active July 1, 2019 00:49
Travis Configuration for Serverless NodeJS Projects
language: node_js
node_js:
- "10"
cache:
directories:
- node_modules
install:
- npm install -g serverless
@EdyVision
EdyVision / mocha.opts
Created June 30, 2019 21:22
Mocha Opts File
--timeout 5000
--reporter list
--ui bdd
--exit
test/bootstrap.test.js
test/**/*.test.js
test/**/**/*.test.js
@EdyVision
EdyVision / .eslintrc.js
Created June 30, 2019 20:17
Sample eslintrc Config File
module.exports = {
"extends": ['eslint:recommended'], // extending recommended config and config derived from eslint-config-prettier
"plugins": ['prettier'], // activating esling-plugin-prettier (--fix stuff)
"rules": {
'prettier/prettier': [ // customizing prettier rules (unfortunately not many of them are customizable)
'error',
{
"singleQuote": true,
"trailingComma": 'none',
"useTabs": false,