How to test a function in gitlab ci/cd (call a function in file and test the result)

Viewed 101

I want to test function by call and pass parameters in gitlab ci/cd (yml file) but I cant see any example about it. Is it possible? please help. Thanks.

this is my gitlab yml file.

stages: 
  #- test
  - build 
  - test
  - testFront
  - testBack
  - testCal

build project:
  stage: build
  image: node:16-alpine
  script:
    - npm install

test website:
  image: alpine
  stage: test
  script:
    - test build/index.html

test front:
  image: alpine
  stage: testFront
  script:
    - test src/app.js

test back:
  image: alpine
  stage: testBack
  script:
    - test server/server.js

test cal:
  image: alpine
  stage: testCal
  script:
    - test src/root-of-equation/bisection-method.js
0 Answers
Related