mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Merge branch 'master' into develop
This commit is contained in:
commit
77f9827359
10
test/panic.html
Normal file
10
test/panic.html
Normal file
@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<script src="http://rawgithub.com/gundb/panic-client/master/panic.js"></script>
|
||||
<script src="http://gungame.herokuapp.com/gun.js"></script>
|
||||
<script type="text/javascript">
|
||||
panic.server('http://192.168.1.103:3000');
|
||||
</script>
|
||||
<body>
|
||||
Happiness :D.
|
||||
</body>
|
||||
</html>
|
36
test/test.panic.js
Normal file
36
test/test.panic.js
Normal file
@ -0,0 +1,36 @@
|
||||
test(function(peers){
|
||||
console.log(peers.just);
|
||||
peers.client(function(){
|
||||
console.log("JESSE FREAK OUT!");
|
||||
localStorage.clear();
|
||||
});
|
||||
|
||||
peers.env({
|
||||
key: 'SUPERPANICAWESOMESAUCEYAY',
|
||||
url: 'http://gungame.herokuapp.com/gun'
|
||||
})
|
||||
|
||||
peers.just("Alice", function(test){
|
||||
var gun = Gun(test.env.url);
|
||||
gun.put({hello: 'WORLD HISTORY!!!!'}).key(this.env.key, function(err, ok){
|
||||
if(!err || (err.err || err).match('memory')){
|
||||
test.done();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
['bob', 'carl', 'dave', 'eve', 'fred'].forEach(function(name){
|
||||
console.log("PEERS!", name);
|
||||
peers.just(name, function(test){
|
||||
var gun = Gun(test.env.url);
|
||||
gun.get(this.env.key).val(function(data){
|
||||
console.log("BOB READ DATA", data);
|
||||
if(data.hello === 'WORLD HISTORY!!!!'){
|
||||
test.done();
|
||||
} else {
|
||||
test.fail("Data was corrupted");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user