Created
August 20, 2020 13:20
-
-
Save roytouw7/e622d1faede866d334111af7c63fa2d3 to your computer and use it in GitHub Desktop.
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
test('isObjectOrSubjectConstructor should identifiy RxJS Subject or Object contructor nodes.', () => { | |
const [node] = createNode<ts.NewExpression>(`new Observable();`, ts.SyntaxKind.NewExpression); | |
const [node2] = createNode<ts.NewExpression>(`new Observable<number>();`, ts.SyntaxKind.NewExpression); | |
const [node3] = createNode<ts.NewExpression>(`new BehaviorSubject<string>();`, ts.SyntaxKind.NewExpression); | |
const [node4] = createNode<ts.NewExpression>(`new NoRxJSSubject<string>();`, ts.SyntaxKind.NewExpression); | |
expect(isObjectOrSubjectConstructor(node)).toBe(true); | |
expect(isObjectOrSubjectConstructor(node2)).toBe(true); | |
expect(isObjectOrSubjectConstructor(node3)).toBe(true); | |
expect(isObjectOrSubjectConstructor(node4)).toBe(false); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment