Best way to build/test AU2

hello,

I want to contribute something to a very specific part of AU2 codebase.
ideally, I want to have a terminal that runs a specific set of tests (in chrome headless).
while watching for changes on a specific area of the codebase, and a specific area of the tests.

I don’t want to use the npm scripts that are currently defined - because they run all of tests - this take several minutes each run.

what is the recommended way of developing features in AU2 are you using?

2 Likes

There’ 3 parts where you can make things run faster:

  • faster recompilation, via tsconfig.json change:
    in the tsconfig.json of the __tests__ package, add the specific folder you want to compile. Example for focusing on 3-runtime-html, change from:
    "include": ["."],
    
    to:
    "include": ["./*.ts", "./3-runtime-html/**/*.ts"],
    
  • focused package, via testDirs change:
    in the karma.conf.js of the __tests__ package, comment out the test folder that you don’t want to run. Example for focusing on runtime-html:
    const testDirs = [
      // '1-kernel',
      // '2-runtime',
      '3-runtime-html',
      // 'fetch-client',
      // 'i18n',
      // 'integration',
      // 'router',
      // 'validation',
      // 'validation-html',
      // 'validation-i18n',
    ];
    
  • focused files, via files change:
    in the karma.conf.js of the __tests__ package, change use a specific file name you want to target in the 2.1 config. Example of focusing on 3-runtime-html/binding-resources.spec.ts for debounce & throttle, change from:
    { type: 'module', watched: true,  included: true,  nocache: false, pattern: `packages/__tests__/dist/esm/__tests__/${name}/**/*.spec.js` }, // 2.1
    
    to
    { type: 'module', watched: true,  included: true,  nocache: false, pattern: `packages/__tests__/dist/esm/__tests__/${name}/**/binding-resources.spec.js` }, // 2.1
    
2 Likes

thank you again. :slight_smile:
Ill try that.

1 Like

@avrahamcool I think your dission is right. You should contribute with AU2. Hopeful i will also contribute with AU2. :slightly_smiling_face:

1 Like