Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always run all V2 tests #78

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
4 changes: 3 additions & 1 deletion crates/atlaspack_plugin_resolver/src/atlaspack_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ impl ResolverPlugin for AtlaspackResolver {
(atlaspack_resolver::Resolution::External, _query) => {
if let Some(_source_path) = &ctx.dependency.source_path {
if ctx.dependency.env.is_library && ctx.dependency.specifier_type != SpecifierType::Url {
todo!("check excluded dependency for libraries");
return Err(anyhow::anyhow!(
"Not implemented: We need to check excluded dependency for libraries"
));
}
}

Expand Down
8 changes: 4 additions & 4 deletions crates/atlaspack_plugin_rpc/src/plugin/resolver.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use std::fmt;
use std::fmt::Debug;

use anyhow::anyhow;
use atlaspack_config::PluginNode;
use atlaspack_core::plugin::PluginContext;
use atlaspack_core::plugin::ResolveContext;
use atlaspack_core::plugin::Resolved;
use atlaspack_core::plugin::ResolverPlugin;
use std::fmt;
use std::fmt::Debug;

#[derive(Hash)]
pub struct RpcResolverPlugin {}
Expand All @@ -24,6 +24,6 @@ impl RpcResolverPlugin {

impl ResolverPlugin for RpcResolverPlugin {
fn resolve(&self, _ctx: ResolveContext) -> Result<Resolved, anyhow::Error> {
todo!()
Err(anyhow!("Not implemented"))
}
}
4 changes: 3 additions & 1 deletion packages/core/core/src/requests/BundleGraphRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ export default function createBundleGraphRequest(
let {assetGraph, changedAssets, assetRequests} = await api.runRequest(
request,
{
force: options.shouldBuildLazily && requestedAssetIds.size > 0,
force:
Boolean(input.rustAtlaspack) ||
(options.shouldBuildLazily && requestedAssetIds.size > 0),
},
);

Expand Down
28 changes: 16 additions & 12 deletions packages/core/integration-tests/test/BundleGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '@atlaspack/test-utils';
import type {BundleGraph, BundleGroup, PackagedBundle} from '@atlaspack/types';

describe.v2('BundleGraph', () => {
describe('BundleGraph', () => {
it('can traverse assets across bundles and contexts', async () => {
let b = await bundle(
path.join(__dirname, '/integration/worker-shared/index.js'),
Expand Down Expand Up @@ -85,12 +85,13 @@ describe.v2('BundleGraph', () => {
]);
});

describe('getBundlesInBundleGroup', () => {
let bundleGraph: BundleGraph<PackagedBundle>;
let bundleGroup: BundleGroup;
describe.v2('getBundlesInBundleGroup', () => {
let dir = path.join(__dirname, 'get-bundles-in-bundle-group');

before(async () => {
async function setupTest(): Promise<{
bundleGraph: BundleGraph<PackagedBundle>,
bundleGroup: BundleGroup,
}> {
await overlayFS.mkdirp(dir);

await fsFixture(overlayFS, dir)`
Expand All @@ -103,20 +104,21 @@ describe.v2('BundleGraph', () => {
yarn.lock: {}
`;

bundleGraph = await bundle(path.join(dir, 'index.jsx'), {
const bundleGraph = await bundle(path.join(dir, 'index.jsx'), {
inputFS: overlayFS,
});

bundleGroup = bundleGraph.getBundleGroupsContainingBundle(
const bundleGroup = bundleGraph.getBundleGroupsContainingBundle(
bundleGraph.getBundles({includeInline: true})[0],
)[0];
});
return {bundleGraph, bundleGroup};
}

after(async () => {
await overlayFS.rimraf(dir);
});

it('does not return inlineAssets by default', () => {
it('does not return inlineAssets by default', async () => {
const {bundleGraph, bundleGroup} = await setupTest();
const bundles = bundleGraph.getBundlesInBundleGroup(bundleGroup);

assert.deepEqual(
Expand All @@ -125,7 +127,8 @@ describe.v2('BundleGraph', () => {
);
});

it('does not return inlineAssets when requested', () => {
it('does not return inlineAssets when requested', async () => {
const {bundleGraph, bundleGroup} = await setupTest();
const bundles = bundleGraph.getBundlesInBundleGroup(bundleGroup, {
includeInline: false,
});
Expand All @@ -136,7 +139,8 @@ describe.v2('BundleGraph', () => {
);
});

it('returns inlineAssets when requested', () => {
it('returns inlineAssets when requested', async () => {
const {bundleGraph, bundleGroup} = await setupTest();
const bundles = bundleGraph.getBundlesInBundleGroup(bundleGroup, {
includeInline: true,
});
Expand Down
4 changes: 2 additions & 2 deletions packages/core/integration-tests/test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {

import {ATLASPACK_VERSION} from '../../core/src/constants';

describe.v2('JS API', function () {
it('should respect distEntry', async function () {
describe('JS API', function () {
it.v2('should respect distEntry', async function () {
const NAME = 'custom-name.js';

let b = await bundle(
Expand Down
Loading
Loading