Welcome to the Linux Foundation Forum!

Is it wrong correct answer in Chapter 6 Quiz?

Options

Hello, I’ve found no correct answer in Packages & Dependencies quiz, question 6.2. As a result system makes Option C as a correct one. By my knowledge and experience, the correct script should contain run for each script execution before script name, like:

npm run lint && npm run test

In other way NPM CLI shows an error: “unknown command…”

Quiz question:

Question 6.2
Given two "scripts" fields in the package.json file named "test" and "lint", which of the following commands would execute both scripts?

A. npm test && npm lint
B. npm run test lint
C. npm run lint && npm test  (Correct)

Answers

  • xdxmxc
    xdxmxc Posts: 148
    Options

    @akaiurin - the package.json contains lint and test field, npm run lint runs lint field, npm test runs test field

  • akaiurin
    akaiurin Posts: 8
    Options

    @xdxmxc said:
    @akaiurin - the package.json contains lint and test field, npm run lint runs lint field, npm test runs test field

    What do you mean under "field"? Is it script in "scripts"?

  • akaiurin
    akaiurin Posts: 8
    Options

    @xdxmxc Oh.. finally, I found paragraph about "test" alias. idk why, but before topic creation, I had tried "test" execution by myself and got an error. Question is solved.

  • xdxmxc
    xdxmxc Posts: 148
    Options

    excellent :+1:

Categories

Upcoming Training