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 11import XCTest
2- import JavaScriptKit
3- @testable import DOMKit
2+ import DOMKit
43
54final class DOMKitTests : XCTestCase {
65 func testExample( ) {
7- let document = DOMKit . Document ( from : JSObject . global. document) !
6+ let document = global. document
87 let button = document. createElement ( localName: " button " )
9- button. textContent = " Hello, world "
8+ button. textContent = " Hello, world! "
109 button. addEventListener ( type: " click " ) { event in
1110 ( event. target as? HTMLElement ) ? . textContent = " Clicked! "
1211 }
1312 _ = document. querySelector ( selectors: " body " ) ? . appendChild ( node: button)
13+
14+ let queriedButton = document. querySelector ( selectors: " body button " )
15+ XCTAssertEqual ( button. textContent, " Hello, world! " )
1416 }
1517}
You can’t perform that action at this time.
0 commit comments