11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciconst common = require('../common');
41cb0ef41Sopenharmony_ciif (!common.hasCrypto)
51cb0ef41Sopenharmony_ci  common.skip('missing crypto');
61cb0ef41Sopenharmony_cicommon.requireNoPackageJSONAbove();
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ciconst fixtures = require('../common/fixtures');
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ciconst assert = require('assert');
111cb0ef41Sopenharmony_ciconst { spawnSync } = require('child_process');
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_ci{
141cb0ef41Sopenharmony_ci  const dep = fixtures.path('policy', 'main.mjs');
151cb0ef41Sopenharmony_ci  const depPolicy = fixtures.path(
161cb0ef41Sopenharmony_ci    'policy',
171cb0ef41Sopenharmony_ci    'dependencies',
181cb0ef41Sopenharmony_ci    'dependencies-scopes-policy.json');
191cb0ef41Sopenharmony_ci  const { status } = spawnSync(
201cb0ef41Sopenharmony_ci    process.execPath,
211cb0ef41Sopenharmony_ci    [
221cb0ef41Sopenharmony_ci      '--experimental-policy', depPolicy, dep,
231cb0ef41Sopenharmony_ci    ]
241cb0ef41Sopenharmony_ci  );
251cb0ef41Sopenharmony_ci  assert.strictEqual(status, 0);
261cb0ef41Sopenharmony_ci}
271cb0ef41Sopenharmony_ci{
281cb0ef41Sopenharmony_ci  const dep = fixtures.path('policy', 'multi-deps.js');
291cb0ef41Sopenharmony_ci  const depPolicy = fixtures.path(
301cb0ef41Sopenharmony_ci    'policy',
311cb0ef41Sopenharmony_ci    'dependencies',
321cb0ef41Sopenharmony_ci    'dependencies-scopes-and-resources-policy.json');
331cb0ef41Sopenharmony_ci  const { status } = spawnSync(
341cb0ef41Sopenharmony_ci    process.execPath,
351cb0ef41Sopenharmony_ci    [
361cb0ef41Sopenharmony_ci      '--experimental-policy', depPolicy, dep,
371cb0ef41Sopenharmony_ci    ]
381cb0ef41Sopenharmony_ci  );
391cb0ef41Sopenharmony_ci  assert.strictEqual(status, 0);
401cb0ef41Sopenharmony_ci}
41