From 72f0d8a763007acde9b72fc62f8165fcb53c5cd7 Mon Sep 17 00:00:00 2001 From: Louise Foussat Date: Thu, 11 Mar 2021 12:52:09 +0000 Subject: [PATCH] fix upperFirst in tell-me-who and tell-me-vip --- .gitignore | 1 + js/tests/tell-me-vip_test.mjs | 4 ++-- js/tests/tell-me-who_test.mjs | 4 ++-- js/tests/test.mjs | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index e0edca4e..6ab1d6df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules rust/**/target/ +js/soluss diff --git a/js/tests/tell-me-vip_test.mjs b/js/tests/tell-me-vip_test.mjs index 535bf805..68ce1dff 100644 --- a/js/tests/tell-me-vip_test.mjs +++ b/js/tests/tell-me-vip_test.mjs @@ -58,8 +58,8 @@ tests.push(async ({ randStr, eq, ctx }) => { return eq('', data) }) -tests.push(async ({ randStr, eq, ctx }) => { - const random = randStr() +tests.push(async ({ randStr, eq, ctx, upperFirst }) => { + const random = upperFirst(randStr()) const files = [ ['Ubaid_Ballard.json', { answer: 'yes' }], ['Victoria_Chan.json', { answer: 'yes' }], diff --git a/js/tests/tell-me-who_test.mjs b/js/tests/tell-me-who_test.mjs index 2fea4652..126fb61c 100644 --- a/js/tests/tell-me-who_test.mjs +++ b/js/tests/tell-me-who_test.mjs @@ -28,8 +28,8 @@ export const setup = async ({ path }) => { return { tmpPath: dir, run, createFilesIn } } -tests.push(async ({ eq, ctx, randStr }) => { - const random = randStr() +tests.push(async ({ eq, ctx, randStr, upperFirst }) => { + const random = upperFirst(randStr()) const fileNames = [ 'Ubaid_Ballard.json', 'Victoria_Chan.json', diff --git a/js/tests/test.mjs b/js/tests/test.mjs index 244b177b..d5889e4e 100644 --- a/js/tests/test.mjs +++ b/js/tests/test.mjs @@ -96,8 +96,9 @@ const runTests = async ({ url, path, code }) => { max || (max = min, min = 0) return Math.floor(Math.random() * (max - min) + min) } + const upperFirst = (str) => str[0].toUpperCase() + str.slice(1) - const tools = { eq, fail, wait, code, path, randStr, between } + const tools = { eq, fail, wait, code, path, randStr, between, upperFirst } tools.ctx = (await (setup && setup(tools))) || {} for (const [i, t] of tests.entries()) { try {