---
title: "Unit Testing GAS Part 3: Adding and Testing Functions | ohhey[blog]"
author: "Brian Bennett"
date: 2019-12-02T07:13:39+00:00
modified: 2019-12-02T07:13:42+00:00
canonical_url: https://pulse.appsscript.info/p/2019/12/unit-testing-gas-part-3-adding-and-testing-functions-ohheyblog/
markdown_url: https://pulse.appsscript.info/p/2019/12/unit-testing-gas-part-3-adding-and-testing-functions-ohheyblog.md
categories:
  - "Snippet"
  - "Solutions"
tags:
  - "blog.ohheybrian.com"
description: "We've looked at how to install and configure QUnit and just finished writing some simple tests. In this post, we're going&nbsp;to write a new method, add(a, b)&nbsp;in&nbsp;Calcs&nbsp;which will add the two passed parameters. Part 3..."
---

# Unit Testing GAS Part 3: Adding and Testing Functions | ohhey[blog]

> We’ve looked at how to install and configure QUnit and just finished writing some simple tests. In this post, we’re going to write a new method, `add(a, b)` in `Calcs` which will add the two passed parameters.

Part 3 in the unit testing series, this post looks at writing tests for new methods and some considerations for when (or when not) to use private functions in Javascript when it comes to testing.

Source: *[Unit Testing GAS Part 3: Adding and Testing Functions | ohhey[blog]*](https://blog.ohheybrian.com/2019/11/unit-testing-gas-part-3-adding-and-testing-functions/)

---

*Published by [Brian Bennett](https://pulse.appsscript.info/p/author/brianbennett/) on [Pulse](https://pulse.appsscript.info/). Original article: [https://pulse.appsscript.info/p/2019/12/unit-testing-gas-part-3-adding-and-testing-functions-ohheyblog/](https://pulse.appsscript.info/p/2019/12/unit-testing-gas-part-3-adding-and-testing-functions-ohheyblog/)*
