mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
18 lines
454 B
JavaScript
18 lines
454 B
JavaScript
test(function(){
|
|
this.just("Alice", function(test){
|
|
var gun = Gun('http://localhost:8080/gun');
|
|
gun.put({hello: 'world'}).key('test', test._terminate.bind(test));
|
|
});
|
|
|
|
this.just("Bob", function(test){
|
|
var gun = Gun('http://localhost:8080/gun');
|
|
gun.get('test').val(function(data){
|
|
if(data.hello === 'world'){
|
|
test.done();
|
|
} else {
|
|
test.fail("Data was corrupted");
|
|
}
|
|
});
|
|
setTimeout(test.fail.bind("Timeout!"),500);
|
|
});
|
|
}); |