Skip to content

Commit f2910fb

Browse files
committed
Script edits
1 parent e93bfb1 commit f2910fb

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

scripts/YouTube/0001.010 - firebase-ssr-starter.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ So I'm using Firebase's CDN links for the SDK...
146146

147147
...which means that the client's browser may already have the CDN files cached.
148148

149-
And I've got full Service Worker caching in place...
149+
And since I have full Service Worker caching in place...
150150

151151
...only the very first page load is ever effected.
152152

@@ -160,7 +160,7 @@ You can find my Firebase SSR Starter code on GitHub.
160160

161161
You're welcome to copy it, but I'd recommend using it as a reference instead.
162162

163-
I used to use other people's app starters for every project.
163+
In my early years developing, I often used other people's app starters for my projects.
164164

165165
It's a great feeling to jump right into building my app-specific features...
166166

@@ -172,10 +172,10 @@ So I'll probably reference this starter app a lot going forward...
172172

173173
...but I'll most likely only use it for my next app...
174174

175-
...because I'll have learned so much by the end of that app, that I'll need to start fresh.
175+
...because I'll have learned so much by the end of that build out, that I'll need to start fresh.
176176

177177
So copy/paste and learn from the past, but don't value it too highly...
178178

179-
...because you always know more now than when you started your last app...
179+
...because you always know more NOW than when you started your last app...
180180

181-
...and you need to be deeply familiar with your entire app if you hope to ship anything valuable.
181+
...and you need to be deeply familiar with your architecture if you hope to ship anything valuable.

scripts/YouTube/0001.011 - test-driven cloud functions.txt

+21-17
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ And make sure to refer to it as TDD, short for test-driven development.
2020

2121
The acronym helps your credibility a lot more than it should.
2222

23-
So let's learn how to write Cloud Functions with test-driven design!
23+
So let's learn how to write Cloud Functions with test-driven development!
2424

2525
PAUSE FOR INTERSTITIAL
2626

@@ -42,7 +42,7 @@ I may have five big, nasty integration tests, and I only want to run one at a ti
4242

4343
...and Jest makes that easy.
4444

45-
What we're going for here is a red/green development cycle.
45+
What we need to achieve is a red/green development cycle.
4646

4747
We write a failing test that imports our module and fails...
4848

@@ -52,11 +52,11 @@ Then we write just enough code in the module under test to make the test pass...
5252

5353
...and we're in a "green" or passed state.
5454

55-
Now rinse and repeat, writing expectations in your tests and regular code...
55+
Now rinse and repeat, writing expectations in your tests and writing regular code...
5656

5757
...switching between "red" and "green" states, until the module is done.
5858

59-
Once the module you're working on is working and all green, run all of your tests.
59+
Once the module you're working on is all green, run all of your tests.
6060

6161
When your tests are all passing, you're good to commit your code to GitHub or wherever...
6262

@@ -86,7 +86,9 @@ Basically, every Cloud Function that we write will be wrapped in a higher-order
8686

8787
...so make sure to drop that terminology in your next interview as well.
8888

89-
So our higher-order wrapping function takes a context object as its one argument...
89+
So we start with a higher-order wrapping function...
90+
91+
...which takes a context object as its one argument...
9092

9193
...and that context object has attributes named `admin` and `environment`.
9294

@@ -150,7 +152,9 @@ The actual act of setting our custom claim would not work without a real life us
150152

151153
Mocking means replacing real code with a fake function that does nothing.
152154

153-
So now that our custom claims call is replaced with a mocked, we can write the rest of our test.
155+
So now that our custom claims call is replaced with a mock...
156+
157+
...we can write the rest of our test.
154158

155159
I've written a `test admin` utility to authenticate a new Firebase Admin SDK instance.
156160

@@ -176,9 +180,9 @@ Our production environment doesn't have the `test dash` prefixes...
176180

177181
And if our tests fail to clean up after themselves, it'll be easy to spot the issue.
178182

179-
Now back to the spec file...
183+
...and now back to the spec file...
180184

181-
...and you'll see that we'll add the `admin` and `environment` variables to a `context` object.
185+
...you'll see that we'll add the `admin` and `environment` variables to a `context` object.
182186

183187
Then we'll initialize two utility functions just for the purposes of this test.
184188

@@ -196,13 +200,13 @@ You don't want to leave any old data lying around, because it could interfere wi
196200

197201
So we have two utility functions, `set custom claims by email` and `remove custom claims by email`.
198202

199-
We'll pass in the `context` object into both so they can set and remove our data.
203+
We'll pass the `context` object into both so they can set and remove our data.
200204

201205
Don't worry about the details of how these functions are working...
202206

203207
...because they're literally just setting and removing data from the Realtime Database.
204208

205-
We still have some more set up to do, so stay strong and let's forge ahead!
209+
We have more set up to do, so stay strong and let's forge ahead!
206210

207211
Next we'll import the actual function that we want to test.
208212

@@ -214,7 +218,7 @@ I like to name my functions generically in my spec files...
214218

215219
...so I've named this function `Func` with a capital `F`.
216220

217-
Now we'll initialize our Firestore database and set our settings.
221+
Now we'll initialize our Firestore database and our Firestore settings.
218222

219223
And we'll need access to our `usersCollection` later, so we'll initialize it here too.
220224

@@ -224,23 +228,23 @@ Every Jest test should be nested within one or more `describe` blocks.
224228

225229
You can nest `describe` blocks as much as you like.
226230

227-
Jest provides `describe` as a global variable that you can use within any Jest spec file.
231+
Jest provides `describe` as a global function that you can use within any Jest spec file.
228232

229-
It also provides `beforeEach`, `afterEach`, `beforeAll` and `afterAll` as global variables.
233+
It also provides `beforeEach`, `afterEach`, `beforeAll` and `afterAll` as global functions.
230234

231235
You can call these `before` and `after` functions within any `describe` block...
232236

233237
...in order to run some code before and after each 'it' block...
234238

235239
...or before and after all of the code in the `describe` block.
236240

237-
`it` is another global variable from Jest that lets us write our actual tests.
241+
`it` is another global function from Jest that lets us write our actual tests.
238242

239243
So we're going to do a bunch of setup in our `beforeEach` function...
240244

241245
...and a little cleanup in our `afterAll`.
242246

243-
Before each test we're going to initiailze our `capital F Func` function...
247+
Before each test we're going to initialize our `capital F Func` function...
244248

245249
...and assign it to a `lowercase f func` variable.
246250

@@ -264,7 +268,7 @@ This is going to be a little disappointing.
264268

265269
See, we just need to define an `it` block and give it a name and a function.
266270

267-
The first test is just to make sure that we got the right environment object.
271+
The first test is simply to make sure that we got the right environment object.
268272

269273
I was fussing around with my environments, and this smoke test makes sure that my setup succeeded.
270274

@@ -300,7 +304,7 @@ It's all available on `Full Stack Firebase dot com`.
300304

301305
The online written material is all free and the entire course is open-source.
302306

303-
You'll need to pay a few buck for the full Udemy course...
307+
You'll need to pay a few bucks for the full Udemy course...
304308

305309
...but it's the culmination of hundreds of hours of work on my part...
306310

0 commit comments

Comments
 (0)