From 043a1f4103f0743a3c6e50eb2e29505d6ac11732 Mon Sep 17 00:00:00 2001 From: horothesun Date: Thu, 21 Jan 2021 00:42:16 +0000 Subject: [PATCH] config.updateCellMinutes --- src/config.js | 3 ++- src/triggers.js | 2 +- test/config.test.js | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/config.js b/src/config.js index 65e0d35..0b723ac 100644 --- a/src/config.js +++ b/src/config.js @@ -1,5 +1,6 @@ const config = { - 'workflow_read_token': 'WORKFLOW_READ_TOKEN - DO NOT SPECIFY - POPULATED AUTOMATICALLY' + 'workflow_read_token': 'WORKFLOW_READ_TOKEN - DO NOT SPECIFY - POPULATED AUTOMATICALLY', + 'updateCellMinutes': 10 } module.exports = { config } diff --git a/src/triggers.js b/src/triggers.js index 69d8ab5..47b100e 100644 --- a/src/triggers.js +++ b/src/triggers.js @@ -8,6 +8,6 @@ function deleteAllTriggers() { } function createTriggers() { - const minutes = 10 + const minutes = config.updateCellMinutes ScriptApp.newTrigger('updateRunsConfigC2Cell').timeBased().everyMinutes(minutes).create() } diff --git a/test/config.test.js b/test/config.test.js index 1e1fe33..a39f920 100644 --- a/test/config.test.js +++ b/test/config.test.js @@ -1,5 +1,9 @@ const { config } = require('../src/config') -test('config has placeholder values', () => { +test('config.workflow_read_token has placeholder value', () => { expect(config.workflow_read_token).toBe('WORKFLOW_READ_TOKEN - DO NOT SPECIFY - POPULATED AUTOMATICALLY') }) + +test('config.updateCellMinutes is defined', () => { + expect(config.updateCellMinutes).toBeDefined() +})