Skip to content

Commit

Permalink
fix(common/web): delete replaceExtension() tests
Browse files Browse the repository at this point in the history
  • Loading branch information
markcsinclair committed Dec 3, 2024
1 parent e197a88 commit 11556a8
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions common/web/types/test/util/test-file-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
sourceTypeFromFilename,
binaryTypeFromFilename,
filenameIs,
replaceExtension,
} from '../../src/util/file-types.js';

describe('Test of File-Types', () => {
Expand Down Expand Up @@ -195,40 +194,4 @@ describe('Test of File-Types', () => {
assert.isTrue(actual);
});
});
describe('Test of replaceExtension()', () => {
it('can replace an extension', () => {
const oldExt = ".cpp";
const newExt = ".js";
const oldFilename = `file${oldExt}`;
const newFilename = `file${newExt}`;
const actual = replaceExtension(oldFilename, oldExt, newExt);
assert.deepEqual(actual, newFilename);
});
it('should return null for incorrect old extension (too short)', () => {
const oldExt = ".ts";
const newExt = ".js";
const oldFilename = `file.c`;
const actual = replaceExtension(oldFilename, oldExt, newExt);
assert.isNull(actual);
});
it('should return null for incorrect old extension (too long)', () => {
const oldExt = ".ts";
const newExt = ".js";
const oldFilename = `file.cpp`;
const actual = replaceExtension(oldFilename, oldExt, newExt);
assert.isNull(actual);
});
// it('should return null for null old extension', () => {
// const newExt = ".js";
// const oldFilename = `file.ts`;
// const actual = replaceExtension(oldFilename, null, newExt);
// assert.isNull(actual);
// });
// it('should return null for null new extension', () => {
// const oldExt = ".ts";
// const oldFilename = `file.ts`;
// const actual = replaceExtension(oldFilename, oldExt, null);
// assert.isNull(actual);
// });
});
});

0 comments on commit 11556a8

Please sign in to comment.