Diff
Not logged in

Differences From Artifact [4794d918ff]:

To Artifact [b5811391cf]:



1
2
3
4
5
6
7
..
13
14
15
16
17
18
19
20
21
22


23
24
25
26
27

28

const App = require('../src/app');
const h = require('../src/helpers');

function createTestApp(scope) {
  return h.autoref(new App({
    id: 'net.maidsafe.test.javascript.id',
    name: 'JS Test',
................................................................................
function createAnonTestApp(scope) {
  const app = createTestApp(scope);
  return app.auth.connectUnregistered();
}

function createAuthenticatedTestApp(scope, access) {
  const app = createTestApp(scope);
  app.auth.loginForTest(access); // Promise, but immediate
  return app;
}



module.exports = {
  createTestApp,
  createAnonTestApp,
  createAuthenticatedTestApp

};
>







 







|


>
>




|
>

1
2
3
4
5
6
7
8
..
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const crypto = require('crypto');
const App = require('../src/app');
const h = require('../src/helpers');

function createTestApp(scope) {
  return h.autoref(new App({
    id: 'net.maidsafe.test.javascript.id',
    name: 'JS Test',
................................................................................
function createAnonTestApp(scope) {
  const app = createTestApp(scope);
  return app.auth.connectUnregistered();
}

function createAuthenticatedTestApp(scope, access) {
  const app = createTestApp(scope);
  app.auth.loginForTest(access || {}); // Promise, but immediate
  return app;
}

const createRandomXorName = () => crypto.randomBytes(32);

module.exports = {
  createTestApp,
  createAnonTestApp,
  createAuthenticatedTestApp,
  createRandomXorName
};