But the pipeline fails with an error. What is the likely cause?
medium
A. The pipeline requires 'deno test' before bundling
B. The file 'mod.ts' does not exist
C. The 'run' keyword is misspelled
D. The '-o' flag is not valid for 'deno bundle'
Solution
Step 1: Check 'deno bundle' syntax
The correct syntax to specify output file is: deno bundle input.ts output.js without '-o' flag.
Step 2: Identify error cause
Using '-o' causes an error because 'deno bundle' does not support it.
Final Answer:
The '-o' flag is not valid for 'deno bundle' -> Option D
Quick Check:
Output file is positional, no '-o' flag = D [OK]
Hint: Use positional output filename, not '-o', with deno bundle [OK]
Common Mistakes:
Adding '-o' flag like other bundlers
Assuming file existence without checking
Thinking 'run' keyword is wrong
Believing tests must run before bundling always
5. You want to create a CI/CD pipeline that runs tests, bundles code, and then deploys only if tests pass. Which YAML snippet correctly represents this sequence?
hard
A. steps:
- run: deno bundle mod.ts bundle.js
- run: deno test
- run: deploy.sh
B. steps:
- run: deploy.sh
- run: deno test
- run: deno bundle mod.ts bundle.js
C. steps:
- run: deno test
- run: deno bundle mod.ts bundle.js
- run: deploy.sh
D. steps:
- run: deno test
- run: deploy.sh
- run: deno bundle mod.ts bundle.js
Solution
Step 1: Determine correct order for CI/CD steps
Tests must run first to verify code, then bundle code, then deploy if tests pass.
Step 2: Match order with options
Only steps:
- run: deno test
- run: deno bundle mod.ts bundle.js
- run: deploy.sh runs tests first, then bundles, then deploys.
Final Answer:
Tests first, then bundle, then deploy -> Option C
Quick Check:
Test -> Bundle -> Deploy = B [OK]
Hint: Test first, then bundle, then deploy in pipeline steps [OK]
Common Mistakes:
Deploying before tests run
Bundling before tests
Changing step order incorrectly
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.