/** * Generates the player code file (Player.js). */ generatePlayerCodeFile() { fs.copyFileSync( PLAYER_CODE_TEMPLATE_FILE_PATH, this.profile.getPlayerCodeFilePath(), ); }
/** * Prepares the epic mode. */ prepareEpicMode() { this.profile.enableEpicMode(); }
api.feed.html.rollup(getStream, { prepend, hidden: contact.hidden, compactFilter: (msg) => msg.value.author !== id, // show root context messages smaller ungroupFilter: (msg) => msg.value.author !== id, updateStream: api.sbot.pull.stream(sbot => sbot.patchwork.profile.latest({ id })) })
nest('profile.async.avatar', function (id, cb) { onceTrue(api.sbot.obs.connection, sbot => { sbot.patchwork.profile.avatar({ id }, cb) }) })
test('prepares next level', () => { game.profile = { goToNextLevel: jest.fn() }; game.generateProfileFiles = jest.fn(); game.prepareNextLevel(); expect(game.profile.goToNextLevel).toHaveBeenCalled(); expect(game.generateProfileFiles).toHaveBeenCalled(); });
// Returns a promise that fulfills iff this user id is valid. function validateAuthData(authData, options) { return apiRequest(options.api_key, authData.auth_token).then(data => { //successful response will have a "stat" (status) of 'ok' and a profile node with an identifier //see: http://developers.janrain.com/overview/social-login/identity-providers/user-profile-data/#normalized-user-profile-data if (data && data.stat == 'ok' && data.profile.identifier == authData.id) { return; } throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Janrain engage auth is invalid for this user.'); }); }
/** * Generates the profile files (README and, if first level, player code). */ generate() { this.generateReadmeFile(); if (this.profile.levelNumber === 1) { this.generatePlayerCodeFile(); } }
test('prepares epic mode', () => { game.profile = { enableEpicMode: jest.fn() }; game.prepareEpicMode(); expect(game.profile.enableEpicMode).toHaveBeenCalled(); });
/** * Prepares the next level. */ prepareNextLevel() { this.profile.goToNextLevel(); this.generateProfileFiles(); }
/** * Prepares the epic mode. */ prepareEpicMode() { this.profile.enableEpicMode(); }
/** * Generates the player code file (Player.js). */ generatePlayerCodeFile() { fs.copyFileSync( PLAYER_CODE_TEMPLATE_FILE_PATH, this.profile.getPlayerCodeFilePath(), ); }
/** * Generates the profile files (README and, if first level, player code). */ generate() { this.generateReadmeFile(); if (this.profile.levelNumber === 1) { this.generatePlayerCodeFile(); } }
test('prepares next level', () => { game.profile = { goToNextLevel: jest.fn() }; game.generateProfileFiles = jest.fn(); game.prepareNextLevel(); expect(game.profile.goToNextLevel).toHaveBeenCalled(); expect(game.generateProfileFiles).toHaveBeenCalled(); });