-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement qualifiedName visitor (#126)
* Implemented qualifiedName visitor Most of the tests are skipped because enum, class, namespace constructions not supported yet. Also modified testHarness runner to be able to join to remotely running rewrite-remote test engine * Implemented type arguments support for qualified names.
- Loading branch information
Showing
3 changed files
with
129 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import {connect, disconnect, rewriteRun, typeScript} from '../testHarness'; | ||
|
||
describe('empty mapping', () => { | ||
beforeAll(() => connect()); | ||
afterAll(() => disconnect()); | ||
|
||
test('globalThis qualified name', () => { | ||
rewriteRun( | ||
//language=typescript | ||
typeScript('const value: globalThis.Number = 1') | ||
); | ||
}); | ||
|
||
test('globalThis qualified name with generic', () => { | ||
rewriteRun( | ||
//language=typescript | ||
typeScript('const value: globalThis.Promise< string > = null') | ||
); | ||
}); | ||
|
||
test('globalThis qualified name with comments', () => { | ||
rewriteRun( | ||
//language=typescript | ||
typeScript('const value /*a123*/ : globalThis. globalThis . /*asda*/ globalThis.Promise<string> = null;') | ||
); | ||
}); | ||
|
||
test.skip('nested class qualified name', () => { | ||
rewriteRun( | ||
//language=typescript | ||
typeScript(` | ||
class OuterClass { | ||
public static InnerClass = class extends Number { }; | ||
} | ||
const a: typeof OuterClass.InnerClass.prototype = 1; | ||
`) | ||
); | ||
}); | ||
|
||
test.skip('namespace qualified name', () => { | ||
rewriteRun( | ||
//language=typescript | ||
typeScript(` | ||
namespace TestNamespace { | ||
export class Test {} | ||
}; | ||
const value: TestNamespace.Test = null; | ||
`) | ||
); | ||
}); | ||
|
||
test.skip('enum qualified name', () => { | ||
rewriteRun( | ||
//language=typescript | ||
typeScript(` | ||
enum Test { | ||
A | ||
}; | ||
const val: Test.A = Test.A; | ||
`) | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters