Navigation

    Quasar Framework

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. baramofme
    B
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 3
    • Best 1
    • Groups 0

    baramofme

    @baramofme

    1
    Reputation
    1
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    baramofme Follow

    Best posts made by baramofme

    • RE: [V1] A guide for @quasar/dotenv

      @ArkIv That’s good.

      dotenv not working my quasar. so I mixed your method + qenv.

      .quasar.env.json

      {
        "development": {
          "ENV_TYPE": "Running Development",
          "ENV_DEV": "Development",
          "API_URL": "https://dev.some.com"
        },
        "production": {
          "ENV_TYPE": "Running Production",
          "ENV_PROD": "Production",
          "API_URL": "https://some.com"
        },
        "test": {
          "ENV_TYPE": "Running Test",
          "ENV_Test": "Test"
        },
        "stage": {
          "ENV_TYPE": "Running Stage",
          "ENV_STAGE": "Stage",
          "API_URL": "https://stg.some.com"
        }
      }
      
      

      quasar.conf.json

      const configEnv = require('./.quasar.env.json')
      
      module.exports = configure(function (ctx) {
        return {
          ......
                env: {
                   // for settting proxy address with ctx.dev, ctx.prod
                   IS_STAGE: false,
                },
          },
      
          devServer: {
            proxy: {
              // proxy all requests starting with /api to specific url
              '/api': {
                target: ctx.prod ? configEnv["production"].API_URL
                : process.env.IS_STAGE ? configEnv["stage"].API_URL
                    : configEnv["development"].API_URL,
                changeOrigin: true,
                pathRewrite: {
                  '^/api': ''
                }
              },
       
      
      posted in Useful Tips (NEW)
      B
      baramofme

    Latest posts made by baramofme

    • RE: [V1] A guide for @quasar/dotenv

      @ArkIv That’s good.

      dotenv not working my quasar. so I mixed your method + qenv.

      .quasar.env.json

      {
        "development": {
          "ENV_TYPE": "Running Development",
          "ENV_DEV": "Development",
          "API_URL": "https://dev.some.com"
        },
        "production": {
          "ENV_TYPE": "Running Production",
          "ENV_PROD": "Production",
          "API_URL": "https://some.com"
        },
        "test": {
          "ENV_TYPE": "Running Test",
          "ENV_Test": "Test"
        },
        "stage": {
          "ENV_TYPE": "Running Stage",
          "ENV_STAGE": "Stage",
          "API_URL": "https://stg.some.com"
        }
      }
      
      

      quasar.conf.json

      const configEnv = require('./.quasar.env.json')
      
      module.exports = configure(function (ctx) {
        return {
          ......
                env: {
                   // for settting proxy address with ctx.dev, ctx.prod
                   IS_STAGE: false,
                },
          },
      
          devServer: {
            proxy: {
              // proxy all requests starting with /api to specific url
              '/api': {
                target: ctx.prod ? configEnv["production"].API_URL
                : process.env.IS_STAGE ? configEnv["stage"].API_URL
                    : configEnv["development"].API_URL,
                changeOrigin: true,
                pathRewrite: {
                  '^/api': ''
                }
              },
       
      
      posted in Useful Tips (NEW)
      B
      baramofme
    • Error: server closed unexpectedly

      When I run test:e2e script with yarn, quasar dev command not working, so script broken unexpectedly.

      "C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\Yarn\bin\yarn.js" run test:e2e
      yarn run v1.22.5
      $ cross-env E2E_TEST=true start-test 'quasar dev' http-get://localhost:8080 'cypress open'
      1: starting server using command "quasar"
      and when url "[ 'dev' ]" is responding with HTTP status code 200
      2: starting server using command "http-get://localhost:8080"
      and when url "[ 'cypress' ]" is responding with HTTP status code 200
      running tests using command "open"
      
      
        ___
       / _ \ _   _  __ _ ___  __ _ _ __
      | | | | | | |/ _` / __|/ _` | '__|
      | |_| | |_| | (_| \__ \ (_| | |
       \__\_\\__,_|\__,_|___/\__,_|_|
      
      
        Running @quasar/app v2.1.6
      
        Example usage
          $ quasar <command> <options>
      
        Help for a command
          $ quasar <command> --help
          $ quasar <command> -h
      
        Options
          --version, -v Print Quasar App CLI version
      
        Commands
          dev, d        Start a dev server for your App
          build, b      Build your app for production
          clean, c      Clean all build artifacts
          new, n        Quickly scaffold page/layout/component/... vue file
          mode, m       Add/remove Quasar Modes for your App
          inspect       Inspect generated Webpack config
          ext, e        Manage Quasar App Extensions
          run, r        Run specific command provided by an installed
                          Quasar App Extension
          describe      Describe a Quasar API (component)
          test, t       Run @quasar/testing App Extension command
                          - requires @quasar/testing App Extension to be installed
                          - this is an alias command for convenience purposes
          info, i       Display info about your machine and your App
          help, h       Displays this message
      
        If the specified command is not found, then "quasar run"
        will be executed with the provided arguments.
      
      Error: server closed unexpectedly
          at ChildProcess.onClose (C:\Users\baram204\WebstormProjects\hanhwa-consultant-web\node_modules\start-server-and-test\src\index.js:69:14)
          at ChildProcess.emit (events.js:315:20)
          at ChildProcess.cp.emit (C:\Users\baram204\WebstormProjects\hanhwa-consultant-web\node_modules\cross-spawn\lib\enoent.js:34:29)
          at maybeClose (internal/child_process.js:1048:16)
          at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
      error Command failed with exit code 1.
      info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
      
      Process finished with exit code 1
      

      I installed test packages with below doc.
      https://testing.quasar.dev/
      https://testing.quasar.dev/packages/e2e-cypress/

      and my package.json looks fine.

       "scripts": {
          ......
          "test:e2e": "cross-env E2E_TEST=true start-test 'quasar dev' http-get://localhost:8080 'cypress open'",
          "test:e2e:ci": "cross-env E2E_TEST=true start-test 'quasar dev' http-get://localhost:8080 'cypress run'",
          "test": "echo \"See package.json => scripts for available tests.\" && exit 0",
          "test:unit": "jest --updateSnapshot",
          "test:unit:coverage": "jest --coverage",
          "test:unit:watch": "jest --watch",
          "test:unit:watchAll": "jest --watchAll",
          "serve:test:coverage": "quasar serve test/jest/coverage/lcov-report/ --port 8788",
          "concurrently:dev:jest": "concurrently \"quasar dev\" \"jest --watch\"",
          "test:unit:ui": "majestic"
        },
        "devDependencies": {
          ......
          "@quasar/quasar-app-extension-testing": "^1.0.0",
          "@quasar/quasar-app-extension-testing-e2e-cypress": "^2.0.1",
          "@quasar/quasar-app-extension-testing-unit-jest": "^2.0.0",
          "eslint-plugin-cypress": "^2.11.1",
          "eslint-plugin-jest": "^23.8.2",
          ....
      

      How can i run quasar dev command inside test:e2e script?

      posted in [v1] App Extensions
      B
      baramofme