23
DEPLOYMENT AND TESTING DANIEL GRAHAM PHD

DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

D E P L O Y M E N T A N D T E S T I N G

D A N I E L G R A H A M P H D

Page 2: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

S H A R I N G E X P O A P P L I C AT I O N O N Y O U R P R O F I L E

{ "expo": { "name": "AckeePod", "slug": "ackeePod", "privacy": "public", "sdkVersion": "32.0.0", "platforms": [ "ios", "android" ],

N E E D T O S P E C I F Y I N Y O U R A P P. J S O N

T H AT Y O U R A P P W I T H B E P U B L I C

Options: •Private •Public •Unlisted

Page 3: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

D E P L O Y I N G T O Y O U R E X P O P R O F I L E

Enable production mode Removes the bloat of

Publish to your profile

Page 4: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile
Page 5: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile
Page 6: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

W H AT A B O U T D E P L O Y I N G T O T H E A P P S T O R E S

Page 7: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

S TA N D A L O N E A P P L I C AT I O N

J S P U B L I S H O N E X P O S E R V E R S

Page 8: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

A P P. J S O N

{ "expo": { "name": "Your App Name", "icon": "./path/to/your/app-icon.png", "version": "1.0.0", "slug": "your-app-slug", "sdkVersion": "XX.0.0", "ios": { "bundleIdentifier": "com.yourcompany.yourappname" }, "android": { "package": "com.yourcompany.yourappname" } } }

Must include these

Page 9: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

A P R I VA C Y P O L I C Y

• Several open source privacy policies

• https://www.docracy.com/mobileprivacy/#description

• Advertisement

Page 10: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

B U I L D I N G T H E P L AT F O R M S P E C I F I C B I N A R I E S• Building IOs binary

• expo build:android

• Remember to replace default icon

• You will need an valid apple

• Building android binaries

• expo build:android

• (Let expo handle your keystore)

Page 11: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

M O N I T O R I N G Y O U R B U I L D S

Page 12: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile
Page 13: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

G O O G L E P L AY D E P L O Y M E N T S

• Tour of the android development console.

Page 14: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

T E S T I N G

• One of the best frameworks for testing react native applications is called JEST

• Delightful Javascript testing

• By the same group that metro (Build system) & yarn( javascript package manager) at facebook

• opencollective.com/jest

• https://www.youtube.com/watch?time_continue=4&v=cAKYQpTC7MA

Page 15: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

G E T T I N G S E T U P I N S TA L L J E S T

npm i jest-expo --save-dev

yarn add jest-expo --dev

Npm test

This is how we would run the JEST test

Page 16: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

A D D T O T H E PA C K A G E . J S O N

"scripts": { "test": "node_modules/.bin/jest" }, "jest": { "preset": "jest-expo" }

Page 17: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

W R I T I N G M E A N I N G F U L T E S T J A S M I N E • Your test should be your spec.

https://jasmine.github.io/setup/nodejs.html

describe(“The cancel button”, function() { var event_manager = load_event_manager() var event = load_event(); event_manager.cancel_event(event);

it(“deletes the event locally", function() { expect(event_manager.find(event)).toBe(undefined); });

it(“deletes the event in the database", function() { expect(db_manager.find(event)).toBe(undefined); });

});

Page 18: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

T E S T I N G

• Integration testing

• Regression testing

• Code coverage

Page 19: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

L E T S T E S T F U N C T I O N T H AT C O N V E R T S M I L L I S E C O N D I N A C K E E P O D T O M I N U T E & S E C O N D S

millisToMinutesAndSeconds(millis) { var minutes = Math.floor(millis / 60000); var seconds = ((millis % 60000) / 1000).toFixed(0); return minutes + ":" + (seconds < 10 ? '0' : '') + seconds; }

Page 20: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

W R I T E A T E S T C A S E F O R A C K E E P O D

test('works', () => { expect(1).toBe(1); })

it('works', () => { expect(1).toBe(1); })

I T I S A N A L I A S F O R

T E S T

Page 21: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

import PlayerScreen from "../components/PlayerScreen"

test('Converts mills to readable format', () => { expect(PlayerScreen.millisToMinutesAndSeconds(1000000)).toBe("16:40"); });

Page 22: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile

T E S T I N G T H E M I L L I S E C O N D F U N C T I O N

import PlayerScreen from "../components/PlayerScreen"

test('Converts mills to readable format', () => { expect(PlayerScreen.millisToMinutesAndSeconds(1000000)).toBe("16:40"); });

static millisToMinutesAndSeconds(millis) { var minutes = Math.floor(millis / 60000); var seconds = ((millis % 60000) / 1000).toFixed(0); return minutes + ":" + (seconds < 10 ? '0' : '') + seconds; }

Page 23: DANIEL GRAHAM PHD DEPLOYMENT AND TESTING · DEPLOYING TO YOUR EXPO PROFILE Enable production mode Removes the bloat of Publish to your profile