Skip to content

Instantly share code, notes, and snippets.

View chriswebb09's full-sized avatar

Christopher Webb chriswebb09

View GitHub Profile
func testDataStore() {
// Setup test
dataStore.searchForTracks { tracks, error in
XCTAssert(tracks?.count == 49)
expect.fulfill()
}
}
import XCTest
import AVFoundation
@testable import Musicly
class MusiclyTests: XCTestCase {
// Boiler plate
func testDataStore() {
let dataSource = iTrackDataStore(searchTerm: "new")
import XCTest
@testable import ExampleProject
class ExampleProjectTests: XCTestCase {
override func setUp() {
super.setUp()
}
override func tearDown() {
class Math {
func add(_ intOne: Int, _ intTwo: Int) -> Int {
return intOne + intTwo
}
}
}).listen(port, (error) => {
if (error) {
console.log('error ${ error }')
}
console.log('listening on ${ port }')
});
import UIKit
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
class APIClient {
typealias JSON = [String: Any]
// search functionality stuff
switch(url.parse(request.url).pathname) {
case '/p1':
if (!error) {
response.end(data);
} else {
console.log(error);
}
case '/p2':
if (!error) {
response.end("Page 2");
fs.readFile(path, function(error, data) {
var path = path.join(__dirname, 'movie.json');
var http = require('http');
var url=require('url');
var fs = require('fs');
var path = require('path');
var port = 3000