File tree Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Expand file tree Collapse file tree 2 files changed +28
-4
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and test
2
+
3
+ on :
4
+ pull_request :
5
+ push :
6
+ branches : [main]
7
+
8
+ jobs :
9
+ macos_test :
10
+ runs-on : macos-11.0
11
+
12
+ steps :
13
+ - uses : actions/checkout@v2
14
+ - name : Run the test suite on macOS
15
+ shell : bash
16
+ run : |
17
+ set -ex
18
+ sudo xcode-select --switch /Applications/Xcode_12.3.app/Contents/Developer/
19
+
20
+ brew install swiftwasm/tap/carton
21
+
22
+ carton test --environment defaultBrowser
Original file line number Diff line number Diff line change 1
1
import XCTest
2
- import JavaScriptKit
3
- @testable import DOMKit
2
+ import DOMKit
4
3
5
4
final class DOMKitTests : XCTestCase {
6
5
func testExample( ) {
7
- let document = DOMKit . Document ( from : JSObject . global. document) !
6
+ let document = global. document
8
7
let button = document. createElement ( localName: " button " )
9
- button. textContent = " Hello, world "
8
+ button. textContent = " Hello, world! "
10
9
button. addEventListener ( type: " click " ) { event in
11
10
( event. target as? HTMLElement ) ? . textContent = " Clicked! "
12
11
}
13
12
_ = document. querySelector ( selectors: " body " ) ? . appendChild ( node: button)
13
+
14
+ let queriedButton = document. querySelector ( selectors: " body button " )
15
+ XCTAssertEqual ( button. textContent, " Hello, world! " )
14
16
}
15
17
}
You can’t perform that action at this time.
0 commit comments