|
@@ -197,6 +197,60 @@ describe('ObfuscatedCodeWriter', () => {
|
|
|
assert.equal(outputCodePath, expectedOutputCodePath);
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+ describe('Variant #5: input directory name with dot only', () => {
|
|
|
+ const inputPath: string = path.join('test-input.js');
|
|
|
+ const rawInputPath: string = path.join('.');
|
|
|
+ const rawOutputPath: string = path.join(tmpDirectoryPath, 'output');
|
|
|
+ const expectedOutputCodePath: string = path.join(
|
|
|
+ tmpDirectoryPath,
|
|
|
+ 'output',
|
|
|
+ 'test-input.js'
|
|
|
+ );
|
|
|
+
|
|
|
+ let outputCodePath: string;
|
|
|
+
|
|
|
+ before(() => {
|
|
|
+ const obfuscatedCodeWriter: ObfuscatedCodeWriter = new ObfuscatedCodeWriter(
|
|
|
+ rawInputPath,
|
|
|
+ {
|
|
|
+ output: rawOutputPath
|
|
|
+ }
|
|
|
+ );
|
|
|
+ outputCodePath = obfuscatedCodeWriter.getOutputCodePath(inputPath);
|
|
|
+ });
|
|
|
+
|
|
|
+ it('should return output path that contains raw output path and actual file input path', () => {
|
|
|
+ assert.equal(outputCodePath, expectedOutputCodePath);
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ describe('Variant #6: input directory name with dot and slash only', () => {
|
|
|
+ const inputPath: string = path.join('test-input.js');
|
|
|
+ const rawInputPath: string = path.join('./');
|
|
|
+ const rawOutputPath: string = path.join(tmpDirectoryPath, 'output');
|
|
|
+ const expectedOutputCodePath: string = path.join(
|
|
|
+ tmpDirectoryPath,
|
|
|
+ 'output',
|
|
|
+ 'test-input.js'
|
|
|
+ );
|
|
|
+
|
|
|
+ let outputCodePath: string;
|
|
|
+
|
|
|
+ before(() => {
|
|
|
+ const obfuscatedCodeWriter: ObfuscatedCodeWriter = new ObfuscatedCodeWriter(
|
|
|
+ rawInputPath,
|
|
|
+ {
|
|
|
+ output: rawOutputPath
|
|
|
+ }
|
|
|
+ );
|
|
|
+ outputCodePath = obfuscatedCodeWriter.getOutputCodePath(inputPath);
|
|
|
+ });
|
|
|
+
|
|
|
+ it('should return output path that contains raw output path and actual file input path', () => {
|
|
|
+ assert.equal(outputCodePath, expectedOutputCodePath);
|
|
|
+ });
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
describe('Variant #5: Win32 environment', () => {
|