Repository: freeCodeCamp/freeCodeCamp
File: curriculum/test/test-challenges.js (JavaScript)

Code before:
          });

          it('Common checks', function () {
            const result = validateChallenge(challenge);

            if (result.error) {
              throw new AssertionError(result.error);
            }
            const { id, title, block, dashedName } = challenge;
            assert.exists(
              dashedName,
              `Missing dashedName for challenge ${id} in ${block}.`
            );
            const pathAndTitle = `${block}/${dashedName}`;
            const idVerificationMessage = mongoIds.check(id, title);
            assert.isNull(idVerificationMessage, idVerificationMessage);
            const dupeTitleCheck = challengeTitles.check(dashedName, block);
            assert.isTrue(
              dupeTitleCheck,
              `All challenges within a block must have a unique dashed name. ${dashedName} (at ${pathAndTitle}) is already assigned`
            );
          });

          const { challengeType } = challenge;

          if (hasNoTests) return;

          let { tests = [] } = challenge;
          tests = tests.filter(test => !!test.testString);
          if (tests.length === 0) {
            it('Check tests. No tests.');
            return;
          }

          describe('Check tests syntax', function () {
            tests.forEach(test => {
              it(`Check for: ${test.text}`, function () {
                assert.doesNotThrow(() => new vm.Script(test.testString));
              });
            });
          });

          if (challengeType === challengeTypes.backend) {
            it('Check tests is not implemented.');
            return;
          }

          // TODO(after python PR): simplify pipeline and sync with client.
          // buildChallengeData should be called and any errors handled.
          // canBuildChallenge does not need to exist independently.
          const buildChallenge =

Review comment (suggestion):
```suggestion
          if (hasNoTests(challengeType)) return;
```

Code after:
          });

          it('Common checks', function () {
            const result = validateChallenge(challenge);

            if (result.error) {
              throw new AssertionError(result.error);
            }
            const { id, title, block, dashedName } = challenge;
            assert.exists(
              dashedName,
              `Missing dashedName for challenge ${id} in ${block}.`
            );
            const pathAndTitle = `${block}/${dashedName}`;
            const idVerificationMessage = mongoIds.check(id, title);
            assert.isNull(idVerificationMessage, idVerificationMessage);
            const dupeTitleCheck = challengeTitles.check(dashedName, block);
            assert.isTrue(
              dupeTitleCheck,
              `All challenges within a block must have a unique dashed name. ${dashedName} (at ${pathAndTitle}) is already assigned`
            );
          });

          const { challengeType } = challenge;

          if (hasNoSolution(challengeType)) return;

          let { tests = [] } = challenge;
          tests = tests.filter(test => !!test.testString);
          if (tests.length === 0) {
            it('Check tests. No tests.');
            return;
          }

          describe('Check tests syntax', function () {
            tests.forEach(test => {
              it(`Check for: ${test.text}`, function () {
                assert.doesNotThrow(() => new vm.Script(test.testString));
              });
            });
          });

          if (challengeType === challengeTypes.backend) {
            it('Check tests is not implemented.');
            return;
          }

          // TODO(after python PR): simplify pipeline and sync with client.
          // buildChallengeData should be called and any errors handled.
          // canBuildChallenge does not need to exist independently.
          const buildChallenge =