1import { withSerializerPlugins } from '../withExpoSerializers';
2
3describe(withSerializerPlugins, () => {
4  it(`executes in the expected order`, async () => {
5    const customSerializer = jest.fn();
6
7    const customProcessor = jest.fn((...res) => res);
8
9    const config = withSerializerPlugins(
10      {
11        serializer: {
12          customSerializer,
13        },
14      },
15      [customProcessor as any]
16    );
17
18    const options = {
19      sourceUrl: 'https://localhost:8081/index.bundle?platform=ios&dev=true&minify=false',
20    };
21    // @ts-expect-error
22    await config.serializer.customSerializer('a', 'b', 'c', options);
23
24    expect(customProcessor).toBeCalledWith('a', 'b', 'c', options);
25    expect(customSerializer).toBeCalledWith('a', 'b', 'c', options);
26  });
27});
28