Skip to content

Instantly share code, notes, and snippets.

async renameFolder (folderId: number, name: string): Promise<Folder> {
// this is an additional DB call in case we want to do app validation
// could be avioded if we run update opration directly
// in most cases it's impact is negligible (but depends on our overall usecase DB throughput)
const folder = await this.dbRepo.findOneBy({
id: folderId
})
// app layer validation - it's going to work in most of the cases
if (folder.name === name) {

Testing

This directory contains three levels of tests:

Unit tests (test/unit)

  • Should target functions and classes directly
  • Server should not be started
  • No external calls depenedencies should be hit
#!/bin/bash
# report file path is passed as first argument to this script like
# parse-report.sh /my-path/serenity.txt
REPORT_FILE_PATH="$1"
# gets the value for passed tests, to get the others just change the pattern /Passed:/ to desired one
# e.g awk '/Ignored:/ {print $NF}'
PASSED_COUNT=$(cat "${REPORT_FILE_PATH}" | awk '/Passed:/ {print $NF}')
FAILED_COUNT=$(cat "${REPORT_FILE_PATH}" | awk '/Failed:/ {print $NF}')
@mgoria
mgoria / introrx.md
Created November 17, 2016 13:52 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing