platform:
  - x64

image:
  - Visual Studio 2015
  - Visual Studio 2017

init:
  - git config --global core.autocrlf true

environment:
  matrix:
    - nodejs_version: 10

clone_folder: c:\projects\opencv-build

install:
  - cmd: choco install cmake -y
  - cmd: choco upgrade cmake
  - ps: Install-Product node $env:nodejs_version x64
  - node --version
  - SET PATH=%PATH%;C:\Program Files\CMake\bin;

build: off

test_script:
  # install and run tests of opencv-build
  - cd c:\projects\opencv-build
  - npm install
  - npm test

  # install opencv4nodejs and run tests
  - cd c:\projects
  - git clone https://github.com/justadudewhohacks/opencv4nodejs
  - cd opencv4nodejs
  # uninstall npm version of opencv-build
  - npm uninstall opencv-build
  # install new opencv-build version
  - npm install ../opencv-build
  - npm install
  - cd test
  - npm install
  - npm run test-appveyor