forked from kishikawakatsumi/JavaScriptBridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJSBTwitterTest.m
More file actions
39 lines (27 loc) · 765 Bytes
/
JSBTwitterTest.m
File metadata and controls
39 lines (27 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#import <XCTest/XCTest.h>
#import "JavaScriptBridge.h"
@import JavaScriptCore;
@interface JSBTwitterTests : XCTestCase
@end
@implementation JSBTwitterTests
- (void)setUp
{
[super setUp];
}
- (void)tearDown
{
[super tearDown];
}
- (void)testInstantiation
{
JSContext *context = [[JSContext alloc] init];
[context addScriptingSupport:@"Twitter"];
JSValue *value = nil;
[context evaluateScript:@"var twrequest = TWRequest.new();"];
value = context[@"twrequest"];
XCTAssertTrue(value && !value.isUndefined);
[context evaluateScript:@"var twtweetcomposeviewcontroller = TWTweetComposeViewController.new();"];
value = context[@"twtweetcomposeviewcontroller"];
XCTAssertTrue(value && !value.isUndefined);
}
@end