{"id":20418822,"url":"https://github.com/marcusoftnet/fizzbuzz-tcr","last_synced_at":"2025-10-16T06:55:12.107Z","repository":{"id":138478700,"uuid":"165248632","full_name":"marcusoftnet/fizzbuzz-tcr","owner":"marcusoftnet","description":"I'm trying out the \"test commit or revert\" ideas on a simple kata","archived":false,"fork":false,"pushed_at":"2019-01-11T13:34:48.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-15T14:15:24.342Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcusoftnet.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-11T13:31:44.000Z","updated_at":"2019-01-11T13:34:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"a52a579c-3b9f-4f88-a779-6b20dd90c024","html_url":"https://github.com/marcusoftnet/fizzbuzz-tcr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcusoftnet%2Ffizzbuzz-tcr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcusoftnet%2Ffizzbuzz-tcr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcusoftnet%2Ffizzbuzz-tcr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcusoftnet%2Ffizzbuzz-tcr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcusoftnet","download_url":"https://codeload.github.com/marcusoftnet/fizzbuzz-tcr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241960882,"owners_count":20049344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T06:34:54.757Z","updated_at":"2025-10-16T06:55:07.053Z","avatar_url":"https://github.com/marcusoftnet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FizzBuzz TCR\nProvoked by [this post](https://medium.com/@kentbeck_7670/test-commit-revert-870bbd756864)\n\n## Initilaization\n\n- npm init .\n- npm i -D mocha chai standard\n- touch index.js and index.test.js\n- package.json scripts for test, lint and pretest\n- wrote a first test to check that tools works\n- pbpaste \u003e .gitignore\n- git init and initial commit\n\n## Setting up commands for TCR\n\n    \"commit\": \"git add -A; timestamp=$(date \\\"+%c\\\") \u0026\u0026 git commit -m \\\"TCR @ $timestamp\\\";\",\n    \"revert\": \"git reset --hard\",\n    \"tcr\": \"npm test \u0026\u0026 npm run commit || npm run revert\"\n\n```javascript\n/* global describe, it */\nconst assert = require('chai').assert\n\ndescribe('Testing', () =\u003e {\n  it('should work', () =\u003e {\n    assert.isTrue(true)\n  })\n})\n```\n\n## First test\nTest:\n\n```javascript\ndescribe('FizzBuzz', () =\u003e {\n  it('returns \"1\" for 1', () =\u003e {\n    const result = fizzBuzzer.single(1)\n    assert.equal(result, '1')\n  })\n})\n```\n\nProduction code:\n```javascript\nmodule.exports.single = (number) =\u003e {\n  return '1'\n}\n```\n**Feeling before tcr-command**: NERVOUS! Will it run?\n**Result**: Passed and commit\n\n## Second test - fail\n**Feeling before tcr-command**: Cocky! This will work...\n**Result**: Ah well...\n* Set up the whole test. Pretty sure of myself... failed and reverted.\n* No production code changed... Hence I returned a constant of `1`.\n*And I even thought that `I didn't change any production code to get this to work... hmmm... this feel strange`\n* Lost documentation too.\n\n## Second test - second run\nTest:\n\n```javascript\n  it('returns \"2\" for 2', () =\u003e {\n    const result = fizzBuzzer.single(2)\n    assert.equal(result, '2')\n  })\n\n```\n\nProduction code:\n```javascript\nmodule.exports.single = (n) =\u003e {\n  return n.toString()\n}\n```\n\n**Feeling before tcr-command**: Careful optimistic but still held my breath during the run.\n**Result**: Passed and commit.\n\n## Refactor tests\n\nTest:\n\n```javascript\n  it('returns \"1\" for 1', () =\u003e {\n    assert.equal(fizzBuzzer.single(1), '1')\n  })\n  it('returns \"2\" for 2', () =\u003e {\n    assert.equal(fizzBuzzer.single(2), '2')\n  })\n\n```\n\nProduction code:\n```javascript\nmodule.exports.single = (n) =\u003e {\n  return n.toString()\n}\n```\n\n**Feeling before tcr-command**: Very confident\n**Result**: Passed and commit.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcusoftnet%2Ffizzbuzz-tcr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcusoftnet%2Ffizzbuzz-tcr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcusoftnet%2Ffizzbuzz-tcr/lists"}