Repository: atom/atom
File: spec/integration/helpers/start-atom.js (JavaScript)

Code before:
  const checkStatus = () =>
    http
      .get(ChromedriverStatusURL, response => chromeDriverDown(done))
      .on('error', done);

  setTimeout(checkStatus, 100);
};

const buildAtomClient = async (args, env) => {
  const userDataDir = temp.mkdirSync('atom-user-data-dir');
  const client = await webdriverio.remote({
    host: 'localhost',
    port: ChromedriverPort,
    capabilities: {
      browserName: 'chrome', // Webdriverio will figure it out on it's own, but I will leave it in case it's helpful in the future https://webdriver.io/docs/configurationfile.html
      'goog:chromeOptions': {
        binary: AtomLauncherPath,
        args: [
          `atom-path=${AtomPath}`,
          `atom-args=${args.join(' ')}`,
          `atom-env=${Object.entries(env)
            .map(([key, value]) => `${key}=${value}`)
            .join(' ')}`,
          'dev',
          'safe',
          `user-data-dir=${userDataDir}`,
        ]
      }
    }
  });

  client.addCommand('waitForPaneItemCount', async function(count, timeout) {
    await this.waitUntil(
      () =>
        this.execute(() => atom.workspace.getActivePane().getItems().length),
      timeout
    );
  });
  client.addCommand('treeViewRootDirectories', async function() {
    const treeViewElement = await this.$('.tree-view');
    await treeViewElement.waitForExist(10000);
    return this.execute(() =>
      Array.from(
        document.querySelectorAll('.tree-view .project-root > .header .name')
      ).map(element => element.dataset.path)
    );
  });
  client.addCommand('dispatchCommand', async function(command) {
    return this.execute(
      command => atom.commands.dispatch(document.activeElement, command),
      command

Review comment (bug):
```suggestion
          `user-data-dir=${userDataDir}`
```

[The linter pointed this out](https://dev.azure.com/DeeDeeG/b/_build/results?buildId=935&view=logs&j=3a559e2a-952e-58d2-b8db-2e604a9266d7&t=6f845a59-a86d-5907-2b45-02c2fb4984eb&l=14): No comma needed on this line, because this is the last item in the list now.

Other than this failing linting due to the extra comma, CI passes if applying these changes on top of `master`:

https://dev.azure.com/DeeDeeG/b/_build/results?buildId=935

Code after:
  const checkStatus = () =>
    http
      .get(ChromedriverStatusURL, response => chromeDriverDown(done))
      .on('error', done);

  setTimeout(checkStatus, 100);
};

const buildAtomClient = async (args, env) => {
  const userDataDir = temp.mkdirSync('atom-user-data-dir');
  const client = await webdriverio.remote({
    host: 'localhost',
    port: ChromedriverPort,
    capabilities: {
      browserName: 'chrome', // Webdriverio will figure it out on it's own, but I will leave it in case it's helpful in the future https://webdriver.io/docs/configurationfile.html
      'goog:chromeOptions': {
        binary: AtomLauncherPath,
        args: [
          `atom-path=${AtomPath}`,
          `atom-args=${args.join(' ')}`,
          `atom-env=${Object.entries(env)
            .map(([key, value]) => `${key}=${value}`)
            .join(' ')}`,
          'dev',
          'safe',
          `user-data-dir=${userDataDir}`
        ]
      }
    }
  });

  client.addCommand('waitForPaneItemCount', async function(count, timeout) {
    await this.waitUntil(
      () =>
        this.execute(() => atom.workspace.getActivePane().getItems().length),
      timeout
    );
  });
  client.addCommand('treeViewRootDirectories', async function() {
    const treeViewElement = await this.$('.tree-view');
    await treeViewElement.waitForExist(10000);
    return this.execute(() =>
      Array.from(
        document.querySelectorAll('.tree-view .project-root > .header .name')
      ).map(element => element.dataset.path)
    );
  });
  client.addCommand('dispatchCommand', async function(command) {
    return this.execute(
      command => atom.commands.dispatch(document.activeElement, command),
      command