fix(fake-driver): copy non-JS files into build dir at transpile time; closes
MODIFY
packages/fake-driver/gulpfile.js
packages/fake-driver/gulpfile.js
const gulp = require('gulp');
const boilerplate = require('@appium/gulp-plugins').boilerplate.use(gulp);
+gulp.task('copy-screen.png', () => gulp.src('./screen.png').pipe(gulp.dest('./build/')));
+
+gulp.task('copy-app.xml', () => gulp.src('./test/fixtures/app.xml').pipe(gulp.dest('./build/test/fixtures/')));
+
boilerplate({
build: '@appium/fake-driver',
testTimeout: 15000,
watchE2E: true,
+ postTranspile: ['copy-screen.png', 'copy-app.xml']
});

MODIFY
packages/fake-driver/lib/fake-app.js
packages/fake-driver/lib/fake-app.js
import { fs } from '@appium/support';
-import { readFileSync, existsSync } from 'fs';
+import { readFileSync } from 'fs';
import path from 'path';
import XMLDom from 'xmldom';
import xpath from 'xpath';
import log from './logger';
import { FakeElement } from './fake-element';
-const screenShotPath = path.join(__dirname, '..', 'screen.png');
-const SCREENSHOT = existsSync(screenShotPath) ? screenShotPath : path.join(__dirname, '..', '..', 'screen.png');
+const SCREENSHOT = path.join(__dirname, '..', 'screen.png');
class FakeApp {
constructor () {

MODIFY
packages/fake-driver/test/helpers.js
packages/fake-driver/test/helpers.js
import path from 'path';
import { remote as wdio } from 'webdriverio';
-import {existsSync} from 'fs';
const TEST_HOST = '127.0.0.1';
const TEST_PORT = 4774;
-// XXX: what dir are we in? it depends on how we're running this test. the .xml file doesn't move, but we do!
-// we may be running with @babel/register; otherwise, we're probably in `build/test/` which _does not_ contain the xml file.
-const appFixturePath = path.join(__dirname, 'fixtures', 'app.xml');
-const TEST_APP = existsSync(appFixturePath) ? appFixturePath : path.join(__dirname, '..', '..', 'test', 'fixtures', 'app.xml');
+const TEST_APP = path.join(__dirname, 'fixtures', 'app.xml');
const BASE_CAPS = {
platformName: 'Fake',

fix(fake-driver): copy non-JS files into build dir at transpile time; closes #15471